Skip to content

ilyabo/geohex.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hexagonal geo-coding system

Build Status

Covering the world in the Mercator projection with a hierarchy of hexagons on multiple zoom levels:

example

Based on the GeoHex library by Tadayasu Sasada.

This is a sister library for this Scala version.

Why hexagons?

There are several advantages hexagonal grids may have over quadratic ones for data visualization, most importantly:

  • better sampling efficiency
  • better perception (visually less biased).

Why hexagons? There are many reasons for using hexagons, at least over squares. Hexagons have symmetry of nearest neighbors which is lacking in square bins. Hexagons are the maximum number of sides a polygon can have for a regular tesselation of the plane, so in terms of packing a hexagon is 13% more efficient for covering the plane than squares. This property translates into better sampling efficiency at least for elliptical shapes. Lastly hexagons are visually less biased for displaying densities than other regular tesselations. For instance with squares our eyes are drawn to the horizontal and vertical lines of the grid.

https://cran.r-project.org/web/packages/hexbin/vignettes/hexagon_binning.pdf

The data model of quadratic cells can cause problems of direction bias or dependence in certain raster analyses that consist of computing new parameters based on a raster cell neighbourhood. ... Hexagon depictions can help to disperse the perception of privileged directions in field model data.

https://www.ralphstraumann.ch/blog/2013/10/hexagons-quasi-maps-and-cartograms/

Squares vs hexagons

squares vs hexagons

How to use

Add this to your HTML file:

<script src="geohex.min.js"></script>
<