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 https://github.com/hobu/hexer.git
cd hexer
sh hobu-config.sh
make
sudo make install
Sample Data
Download EPA Shapefile of Superfund sites and stuff
Unzip those files and make a spherical mercator version.
unzip EPA_ShapefileDownload_07212013.zip
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
Rendering
I used TileMill to render the result, but it's a Shapefile so you can use anything.
#binned {
polygon-opacity:0.8;
}
#binned[COUNT > 0] {
polygon-fill:#e0ecf4;
}
#binned[COUNT > 50] {
polygon-fill:#9ebcda;
}
#binned[COUNT > 100] {
polygon-fill:#8856a7;
}