Ultimately, I decided to build my own little system around M.E.J. Newman's cart and interp programs. The programs are written in vanilla C and compiled properly on my Mac [1]. The paper describing the detailed algorithm [2] is also available. I already had a file with state outlines that I had obtained from Wikipedia. A couple hundred lines of Perl later, and I had working code that would generate cartograms for the 48 contiguous states plus the District of Columbia, using Dr. Newman's programs to do the hardest part. There's still a lot of details to attend to to make things a bit more general and more automatic, but at least I can play with maps.
The next map is distorted so that the area of each state reflects its population. The proportions are not perfect, but close. The errors are probably due to my using too little padding around the map. The Gastner and Newman paper discusses how much padding is appropriate, and I used less than they recommend. In areas where the population density is roughly the same over adjacent states (eg, Illinois, Indiana, and Ohio) the shapes of the states are recognizable. Where density changes drastically (eg, California) the shapes are more distorted. This is the classic problem for cartograms -- how to adjust parameters so that things don't get distorted too badly.
The next map is distorted so that the area of each state represents the size of the federal land holdings within that state. The same 11 states are shaded violet in this map and the preceding one. It is one thing to read that most such holdings are in the West; the cartogram makes that painfully obvious. The two violet areas can't be compared directly; the total areas of the 48 states in the two distorted maps don't match. With some care, though, the diffusion algorithm should make it possible to set things up so that the maps can be compared.
Finally, just to show that I can do it, the basic red/blue map distorted by each state's electoral votes for the 2012 Presidential election. Note how prominent Washington, DC becomes in this map, as it expands so its area is equal to that of the other states with three votes (eg, Wyoming and Vermont). As always, there are lots of things that could be done with color shading to convey additional information.
[1] The programs depend on one external library for an implementation of the Fast Fourier Transform. That library is also free, has been ported to many operating systems, and built just fine on my Mac.
[2] Michael T. Gastner and M. E. J. Newman (2004) Diffusion-based method for producing density equalizing maps, Proc. Natl. Acad. Sci. USA 101, 7499-7504.
No comments:
Post a Comment