NOTE: My original question was about interpolation methods, but I've found that I was actually asking the wrong question. Interpolation methods with Heatmaps and IDW are the least of my problems right now.

I've been investing a lot of time trying to understand heatmaps visualizations in the context of GIS in the last month. There's a lot of information, theory and a gazillion different implementations and stacks, it's very easy to be lost in this sea of information, hence, I'm here asking for help ;)

Right now, I'm using PostGIS + GeoServer as map-sever middleware + Leaflet for the client.

But my main question is really about the visualization below:


Screenshot: enter image description here

And also, here's one of the tiles: enter image description here

1) Is this a choropleth or a heatmap, or what is the right term for this visualization? If someone knows specifically what kind of heatmap that is, please let me know.

2) I'd love to emulate this style with geosever (or any other software / stack of software for tha matter, this one is served as tiles from the server). Should I just invest more time learning SLD or should I just go custom and implement the rendering code myself? Does anyone with more experience than I have put in me in the right direction?

The data

Lastly but not least, the data that I'm plotting is simple, but it might be tens of thousands of points representing buildings/apartments/houses in a city, and the heatmap would be value-based, by revenue per month, for instance. So, lat/lon + a value (revenue). I want to plot that in a heatmap similar to the one shown above.

closed as too broad by PolyGeo Aug 29 '17 at 21:10

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Hi toms. Yep, I checked the Leaflet.heat leaflet plugin. Unfortunately it does not implement the IDW viz method yet, which is the one I need. See bit.ly/1JZvbo9 and bit.ly/1dWiHzg (both are URLs point to github issues). – FullOfCaffeine Jul 13 '15 at 16:27
  • I've found what seems to be a concrete implementation of IDW in the processing language, here: bit.ly/1Ht4Knc. I'll play with it a bit and if it fits my purposes, I'll add an answer here explaining how to use it with heatmap js libraries. It's so strange that libraries such as heatmap.js, mapbox.js, carto.js and Leaftlet.heat don't mention/implement the different heatmaps viz. algorithms, like IDW. – FullOfCaffeine Jul 14 '15 at 22:05

enter image description here

This is not exactly what you asked for, but it could be a suitable starting point for your heatmap.

I created a simple python script for converting geohashes to 3d Google Earth representations. This isn't exactly what you asked for, but if you'd like to create a cool looking thematic map (based on geohash) this will get you started.

You can get the code on github here: geohash2kml

  • Hey @abeusher, thanks for the post. I'll check out the code, even if for the reference of how the actual heatmap calculations are done. – FullOfCaffeine Jul 16 '15 at 16:22

I think you should play around with GeoServer, and you can start with the examples here. It should be easy enough to follow.

GeoServer will be doing something that you have less control over, though, and if you want to actually to interpolation, I'd use QGIS, or if you have money, ArcGIS (it does Kriging easily, which is super-fancy mathematically magical interpolation). If you use QGIS, play around with IDW, and look in the processing toolbox for some other methods.

If you want something that looks good, but don't care if it is doing a mathematically correct thing, use GeoServer or Leaflet to do an on-the-fly heatmap. If you do care, run through some of the algorithms and make a raster dataset to load into GeoServer later.

  • Hi Alex, thanks for the reply! I'm currently using PostGIS, by the way. I realized today that I might be looking into the wrong abstraction level. I might need to actually do the whole shape transformation in PostGIS and style with SLD at the geoserver level. So it'd be easier to create the heatmap by applying a SLD style, but the shape (cloropleth) would be already returned by the PostGIS query. Does that make sense? – FullOfCaffeine Jul 24 '15 at 2:56
  • By the way, I tried pretty much all the javascript heatmap plugins, including Leaflet.heat and Heatmap.js, but they don't work the way I want, i.e the heatmap shape changes as you zoom in/out, and eventually you'll see the individual points (bit.ly/1HWpQsa). I also tried the geosever raster transformation examples, but couldn't get something that looked the way I want yet, but as I said above, I probably need to play with SLD a bit more (maybe PostGIS). The best example of how I want the heatmap to look and behave, is the Walkscore link/screenshots I added in the post. – FullOfCaffeine Jul 24 '15 at 3:07
  • I'd load the points in PostGIS and then use QGIS to make a raster then. You can use GeoServer to style the raster after that. Or you could then polygonise it and have your vector contour areas as your data that's styled in GeoServer. Note that yo ucan export QGIS styles to SLD, which works around 90% (but keep the styles simple!). SLD is hard to learn, but good enough. – Alex Leith Jul 24 '15 at 3:22
  • "I'd load the points in PostGIS and then use QGIS to make a raster then", when you say "use QGIS to make a raster", what do you mean exactly? Could you point me to an article or tutorial about that? Thanks! – FullOfCaffeine Jul 24 '15 at 17:34
  • I think I got it. The problem I see with using QGis to make a raster is that it'd be a bit harder to automate, say, for an interactive map on the web. PostGIS can easily be part of the pipeline, but unless qgis can be scripted and called from the CLI, I'd say it'd be more awkward than using PostGIS to build this raster. I guess that, for learning purposes and to find out what I need in terms of raster, using QGis would be acceptable to start with. What do you think? – FullOfCaffeine Jul 24 '15 at 17:46

If you want to use GeoServer and, if I read correctly, you want a true interpolation, not a heatmap, check out the "Barnes surface" interpolation here: http://suite.opengeo.org/opengeo-docs/cartography/rt/barnes.html?highlight=barnes

It's documented in the OpenGeo suite only, but it's actually part of a standard GeoServer too.

Not the answer you're looking for? Browse other questions tagged or ask your own question.