Skip to content

Instantly share code, notes, and snippets.

Last active December 28, 2015 03:38
  • Star 9 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tmcw/7436261 to your computer and use it in GitHub Desktop.
Hexer is Cool

hexer is cool. It's a new project by Howard Butler that makes hexagon binned files out of point files.

Building hexer

This worked on my system (OSX 10.9, git via homebrew)

git clone
cd hexer
sudo make install

Sample Data

Download EPA Shapefile of Superfund sites and stuff

Unzip those files and make a spherical mercator version.

ogr2ogr -t_srs EPSG:900913 frs_merc FRS_Facilities.shp

Running hexer

Then make the bins. The --edge option lets you control how big the bins are - experiment with a few values to determine what the best ratio of accuracy versus aggregation is for your dataset.

./curse density --input=frs_merc/FRS_Facilities.shp --output=binned.shp --edge 1000


I used TileMill to render the result, but it's a Shapefile so you can use anything.

#binned {
#binned[COUNT > 0] {
#binned[COUNT > 50] {
#binned[COUNT > 100] {

Finished TileMill Map

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment