def CreateRubberSheetCartogram

Big ups to Eric Wolf, who recently released his Python script to generate continuous, “rubber sheet” cartograms. In this case, rather than the ever-so-popular Gastner-Newman diffusion-based method (2004), Wolf uses the Dougenik, Chrisman, and Niemeyer (1985) algorithm. Of the method, the authors initially wrote,

Cartograms are controversial in part because they are difficult to construct and the results seen to date [1985] are crude or imprecise or both. They also may communicate poorly to some audiences. Our computer algorithm attempts to redress the balance by providing a new approach to constructing precise cartograms.

This same method is used by Adrian Herzog in Mapresso.

One of the coolest things about Wolf’s adaptation is that it works directly from shapefiles/dBase files. And it is only dependent on the GDAL/OGR library. I created the above cartogram of British county populations with the following line:

python pyCartogram.py gb.shp gbCarto.shp population 5

The above runs the algorithm 5 times on the gb.shp shapefile, using the variable population. It took only about a dozen seconds, though it produces no report as to the overall area accuracy of the cartogram. I then simply loaded the output shapefile in Flash to capture the above image.

In general, I feel the Dougenik, Chrisman, and Niemeyer algorithm produces cartograms no more readable than the Gastner-Newman algorithm (which is to say that neither is very aesthetically pleasing or readable). Thus, I’m a much bigger fan of semi-manual methods, like those produced by Mapping Worlds, or the fully manual “block” cartograms employed by the NY Times. That said, Eric Wolf’s work is a great achievement. It’s just great to see more cartogram algorithms implemented in Python.

One Comment

  1. I can’t find the code on Eric’s site. Any pointers?

    Thouis Jones
    Posted October 10, 2008 at 9:05 pm | Permalink

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*