Building effective heat-maps?

This question has been converted to Community Wiki and wiki locked because it is an example of a question that seeks a list of answers and appears to be popular enough to protect it from closure. It should be treated as a special case and should not be viewed as the type of question that is encouraged on this, or any Stack Exchange site, but if you wish to contribute more content to it then feel free to do so by editing this answer.


There are at least two different kinds of heat maps:

  1. Heatmaps representing concentration of points, and
  2. Heatmaps representing distributions of attribute values

Every method has advantages and problems, I'm afraid going into detail is far beyond this Q&A.

I'll try to list some methods and functions for QGIS and GRASS.

Concentration of points

If you are tracking movement of wildlife, vehicles, etc. it can be useful to assess regions with high concentration of location messages.

Tools: e.g. QGIS Heatmap plugin (available in versions > 1.7.x) or GRASS v.neighbors or v.kernel

Distributions of attribute values

Here, we're basically talking more or less about interpolation methods. Methods include:

  1. IDW

    Depending on the implementation this can be global (using all available points in the set) or local (limited by number of points or maximum distance between points and interpolated position).

    Tools: QGIS interpolation plugin (global), GRASS v.surf.idw or r.surf.idw (local)

  2. Splines

    Again, huge number of possible implementations. B-Splines are popular.

    Tools: GRASS v.surf.bspline

  3. Kriging

    Statistical method with various sub-types.

    Tools: GRASS v.krige (thanks to om_henners for the tip) or using R.


Statistically, here is how you should go about doing a heat map:

1) Integrate point features. The idea of integration is to take points that should be considered coincident and merge them together as a single location. I like to use nearest neighbor analysis and use an appropriate value from there. (For example, when doing a crime heat map, I use the average 1st nearest neighbor for the underlying parcel dataset against which the crimes are geocoded).

2) Collect events. This creates a spatial weight for all of your integrated points. E.g. if you have 5 events at a single location, it will become one point with weight 5. This is essential for the next two steps. If you need to aggregate an attribute in the events pooled, i.e. different events have higher weight, then you can use a one-to-one spatial join. Use the 'collect event' output as the target and your original integrated events as the join features. Set the field map merge rules statistically combined the attribute on the integrated events (normally with a SUM, though you can use other statistics).

3) Determine peak spatial autocorrelation using Global Moran's I. Just like it says, run global moran's I at different intervals to determine the peak band of spatial autocorrelation in the scale appropriate to the analysis you are doing. You might want to run nearest neighbor again on your collected events to determine the start range for your moran's I tests. (e.g. use the max value for first nearest neighbor)

4) Run Getis-Ord Gi*. Use a fixed distance band based on your moran's I analysis, or use the fixed distance band as a zone of indifference. Your spatial weight from collect events is your numeric count field. This will give you z-scores for each event point in your set.

5) Run IDW against your outcomes from Getis-Ord Gi*.

This outcome is significantly different from what you get with kernel density. It will show you where high values and low values are clustered together rather than just where values are high, without regard to clustering, like in kernel density.


While I like heat maps, I realize they are often mis-used.

Typically what I've seen is a process whereby the color of each pixel is based on the result of an inverse distance weighted function applied to a collection of points. Any time a map has a lot of overlapping point markers, I think it is worth considering a heatmap.

Here's a web based api.

GeoChalkboard has a good tutorial for it.

You can use IDW in ArcGIS.