Closed jcworkma closed 9 years ago
Heatmapjs looks cool, only it seems to only support points. Not a show stopper, but you might want to figure out how to handle a polygon.
Ok is then would you like something more like a choropleth map style?
http://wrobstory.github.io/2013/04/python-maps-choropleth.html Could be an example it needs more detail and using the world.
You'll probably want to stay in Javascript so that way its intractable in a browser. OpenLayers has some vector options and some heat map options that might be worth trying out.
Another option is to rasterize a polygon into points and using that for heatmapjs or equivalent.
Last meeting we decided to move forward with polygons on the heatmap and not "blobs". We can implement the polygons but are having trouble finding a data source to provide us with the polygon coordinates of a location.
The ability to outline a polygon of a location exists in Google Maps (try this search for "phoenix, arizona"), but the Google Maps API does not provide a method of accessing a polygon's coordinates.
We are not alone in the quest for polygon coordinates:
Reading the above posts directs you to Twitter's API that gives you the ability of retrieving a "bounding box" of a searched "place". We are investigating if this is a sufficient and accurate source of polygon data.
We can (and should) still approximate an street address as a point, however at some size (maybe 1 square mile?) moving to a polygon would be much more useful.
I would suggest starting with the large regions (countries, states, and cities) first and then work your way down. You could look at the TIGER shapefile data for inside the US and convert it to postgis with the shp2pgsql utility. There also is thematicmapping.org that can provide world wide countries and areas.
Shape files are a pretty common format for vector data. Fair warning: pay attention to your map projection when using these utilities, chances are you're going to get data in two different projections.
The "bounding box" of a searched "place" could be a good approximate to start with, especially for computing how two regions compare (do they intersect? is one inside the other? etc)
Just another thought; if you knew the relative size of your locations (categorically speaking, so a city vs an street address) you could use your existing points and create a circle with a radius proportional to the size. The scope of this database isn't to accurately define the extent of a region so a circle approximation would be better than nothing.
Research javascript heatmap open-source libraries for use in our project