Where’s interesting?

Visualising geographic statistics usually means drawing a coloured map (called a choropleth), but this can be confusing as the human brain tends to associate importance with the area covered. For example, first impressions of the choropleth for the U.S. presidential elections would give the misleading impression that the Republicans won, as 56% of the map pixels are red. However, there is a different style of maps (called cartograms) in which the map is warped such that the area is proportional to the data being visualised.

We can use cartograms of OpenStreetMap data to present a more visually striking and interesting view of the world. For example, here is a cartogram of the distribution of Points of Interest (POIs). It is immediately obvious that most of the POIs in the world are either in the United Kingdom or Germany, but there are other interesting POI-rich pockets; the Philippines, Brasil, South Africa and Eastern Australia. Many thanks to all the contributors in these areas for their fantastic work!

Derived from OpenStreetMap data, CC-BY-SA OpenStreetMap and contributors

Generating cartograms can be quite easy as the authors of “Diffusion-based method for producing density equalizing maps” have generously made their software available online.

First the data needs to be collected. For the case of the POI cartogram, I used the PostGIS database commonly used for Mapnik rendering to extract the geographic distribution of POIs on an evenly spaced grid 1024×1024 pixels in size. When formatted as an ASCII text file, one line per row of space-separated decimal numbers, it can be fed into the cartogram software. This takes a while and tends to converge slowly when the deformation is very large - about 2 hours for the POIs graph on my laptop.

The cartogram software then outputs a 1025×1025 file in the same format giving the new locations for each of the pixel corners in the input file. This can be used to warp a shape file, in this case world_boundaries_m, and render with OpenJUMP to produce the pretty output above!

by Matt Amos, CloudMade London

November 7th, 2008 - Posted by Matt Amos in openstreetmap, tips, tools | |

4 Responses to ' Where’s interesting? '

Subscribe to comments with RSS or TrackBack to ' Where’s interesting? '.


  1. on November 7th, 2008 at 4:12 pm

    [...] Via Cloudmade. [...]

  2. Dave said,

    on November 7th, 2008 at 5:25 pm

    I hope you intend to make a historical animation of this!

  3. Alex said,

    on November 8th, 2008 at 1:13 pm

    Nice… but I cannot find Africa ;-(

  4. Mike said,

    on November 10th, 2008 at 3:54 pm

    The issue with area being granted importance in choropleths is spot on, a point that is difficult for many to grasp. The election map is probably a poor example as it is categorical, but I get your meaning. It is possible to correct for the affect of area by normalizing the data by area (POI per square kilometer) and using an equal area projection, but I admit, they are not as interesting as these cartograms. :)

    I had been looking for an automated cartogram process for sometime, I much prefer the blocky versions, but these are certainly fun to view, espeically when the area is distorted beyond recognition. The emphasis on the data is striking.

    As per Dave’s comment, I see a lot of value in animating these types of cartograms, especially if a user can snap back to a more recognizable view.

Leave a reply