How to create a heatmap without external services?
December 12, 2012 7:39 AM   Subscribe

How can I create heatmaps of geographic data, without relying on an external web service or API?

I've got a large, ever-changing dataset that includes geographic data from almost every country. The data include lat/lon coordinates, ISO country codes, city/region name, and a count (number of "incidents" reported).

As part of a larger, web-browser-based dashboard, I'd like to create a heatmap showing which countries / regions have the most incidents. But, for various reasons, the web server this is on doesn't always have the ability to talk out to the Internet, so it can't rely on an external service, like Google Maps.

Is there a standalone, free-and-open-source package that would let me do this? Needs to run on a linux server with nginx, and bonus points if it's Python.
posted by fvox13 to Computers & Internet (5 answers total) 6 users marked this as a favorite
Matplotlib to the rescue!
posted by blue t-shirt at 7:41 AM on December 12, 2012 [2 favorites]

QGis is a free and open-source mapping tool. It also can work with Python. I have no idea if it'll do what you're looking for, though.
posted by troika at 7:42 AM on December 12, 2012

Thanks! I think I'll try Matplotlib first, since it seems a lot more straightforward. It won't be as "accurate" as QGis, probably, but pinpoint accuracy in an image that's only going to be like 300x200 is pointless anyway....
posted by fvox13 at 8:09 AM on December 12, 2012

Another option, not necessarily better than the previous good suggestions: For my personal web site, I use OpenLayers in the web page with an intermediate cache of tiles. Tiles are downloaded from OSM to my server, and then re-served from there. As long as you're only viewing areas that you've viewed when the server was previously connected to the net at large, this could let you build a web tool easier than with QGIS.

And if you need to render tiles yourself, Mapnik has Python bindings.
posted by straw at 8:40 AM on December 12, 2012

For completeness, I'd just like to add PyNGL and Generic Mapping Tools (GMT) (possibly via GmtPy). But I'd incline to agree with blue t-shirt: matplotlib using the basemap toolkit is probably the easiest and most pythonic.
posted by pont at 11:18 AM on December 12, 2012

« Older If those Yankees can do it, then so can I. How to...   |   Inattentive ADHD Newer »
This thread is closed to new comments.