So I've been toying with "heatmaps", and I've been drawing maps of real estate price trends in Edinburgh:

click here for fullscreen

in Montreal:

click here for fullscreen

and in Sofia:

click here for fullscreen

Algorithm

Conceptually, the algorithm evaluates, for every pixel "p" on the map, a weighted average of all observed flats prices in town, the weights being given by a gaussian of the distance from "p" to the pixel where the flat appears on the map. In other words, every pixel's colour corresponds to an average of the flat prices immediately surrounding it, as well as, to a lesser extent, flats further away.

The resulting values are mapped directly to a simple linear HSB colour spectrum that goes from pure blue to pure red.

A density function determines the heatmap opacity, making the heatmap layer transparent in areas where we have little or no data, such as large parks. That function is based on a sigmoid of the sum of the weights used in the weighted average described above. The sigmoid keeps the density uniform everywhere, while creating a quick fade-out where the data gets too sparse.

The code is written in Java and is available here:

https://www.assembla.com/code/saintamh/subversion/nodes/tilemaker/

The data were found on real estate websites.

Other heatmaps from elsewhere on the web