Skip to content

Create hexmaps from geoJSON boundary files using an energy minimisation technique.

License

Notifications You must be signed in to change notification settings

danbillingsley/AutoHex

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AutoHex

Create hexmaps from geoJSON boundary files using an energy minimisation technique.

How it works

  1. Load a GeoJSON file and find the centroid of each polygon (we use Leaflet to help with).
  2. Create a grid of hexes, and place the collection of centroids on top of it.
  3. In turn, the nearest unassigned hex to each centroid is highlighted. An "energy cost" is calculated which penalises the distance between each centroid and its corresponding hex.
  4. Slightly reduce the scale of the collection of centroids and repeat step 3.
  5. Repeat until the scale is tiny and then select the zoom at which.
  6. We use Raphael.js to visualise all of this.
  7. We output HexJSON of the final configuration.
  8. The HexJSON is visualised using a HexJSON to HTML library.

About

Create hexmaps from geoJSON boundary files using an energy minimisation technique.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 92.8%
  • HTML 4.0%
  • CSS 3.2%