Posts Tagged ‘indiemaps’

Noncontiguous Area Cartograms (IndieMaps)

Monday, March 2nd, 2009

[Editor's note: Zach Johnson promotes his Actionscript 3 class for producing non-continuous cartograms and gives background on why these are better (and easier to construct) than Gaster-Newman continuous cartograms.]

Excerpted from IndieMaps blog by Zach Johnson.
View full blog post from Dec. 4, 2008.

Fully contiguous cartograms have stretched and distorted borders but perfectly maintained topologies. Like the Gastner-Newman diffusion-based cartograms we see all over the place. Though all sorts of cartogram designs have been produced, those with perfect topology preservation (fully contiguous cartograms) receive the majority of academic and popular press attention.

< snip >

Judy Olson (Wisconsin Geography alum natch) wrote the only academic article to focus specifically on this cartogram symbology in 1976. She believed noncontiguous cartograms held three potential advantages over contiguous cartograms (I’ve three more below):

  1. “the empty areas, or gaps, between observation units are meaningful representations of discrepancies of values, these discrepancies generally being a major reason for constructing a cartogram”
  2. production of noncontiguous cartograms involves “only the discrete units for which information is available and only the lines which can be accurately relocated on the original map appear on the noncontiguous cartogram”
  3. because of perfect shape preservation, “recognition of the units represented is relatively uncomplicated for the reader”

Despite these inherent advantages (along with ease of production), all the early value-by-area cartograms I’ve seen maintain contiguity. Some took the radical step of abstracting features to geometric primitives, like Levasseur’s early French examples (which may not have been cartograms) and Erwin Raisz’s early American “rectangular statistical cartograms”. But in many ways the noncontiguous design is the more radical cartogram, as it actually breaks the basemap apart — rather than skewing shared borders it abandons them.

my [his] AS3 classes

Olson outlines a technique — the projector method — for manually producing such cartograms. A projector capable of precise numeric reduction/enlargement was required, but not much else, and accurate cartograms could be produced in minutes. A scaling factor was calculated for each enumeration unit, the projector was set to this value, and the projected borders were traced, keeping units centered on their original centers.

My [his] AS3 NoncontiguousCartogram class works similarly. It takes an array of objects containing geometry and attribute properties and creates a noncontiguous cartogram. I include methods for creating the input array from a shapefile/dbf combo, but using KML, WKT, or geoJSON representations wouldn’t be too hard. Methods are included for projecting this lat/long linework (to Lambert’s Conformal Conic projection at least). The NoncontiguousCartogram class draws the input geography, figures the area of each feature, and scales figures according to their density in the chosen thematic variable.

It’s all good/in ActionScript 3, so can be used in Flash or Flex. The zip distribution includes the following:

  • the main class
  • two example applications and the data needed to run them
  • utility classes, including some that make creating cartograms from shp/dbf input quite easy
  • Edwin Van Rijkom’s SHP and DBF libraries, which are used to load the shapefiles in both of the included examples
  • Keith Peters’ MinimalComps AS3 component library, for the components used in one of the examples
  • Grant Skinner’s gTween class, which is required by the NoncontiguousCartogram class for tween transitions

Browse all the above or download the zip.


more advantages

In my thesis research last spring, noncontiguous cartograms performed quite well: subjects rated them highly on aesthetics and could locate and estimate the areas of features with relatively high accuracy. I would add the following to Olson’s list of noncontiguous cartogram advantages.

  1. Olson concentrates on the perfect shape preservation of noncontiguous cartograms. The form (well, those with units centered on the original enumeration unit centroids, as in Olson’s projector method) also perfectly preserves the location of the features on the resultant transformed cartogram. Not only are features easier to recognize, but locations within the transformed units can be accurately located as well (cities or mountain ranges from the original geography can be accurately plotted on the transformed cartogram).
  2. Because units are separate on the transformed cartogram, their figure-ground is increased and areas of features can therefore be more accurately estimated.
  3. Many cartogram designs (including most manual cartograms and the Gastner-Newman-produced cartograms) sacrifice some accuracy for shape recognition. This is a defensible tradeoff, especially as area estimation is notoriously inaccurate and nonlinear. Yet it’s a tradeoff that noncontigous cartograms need not make, as they can always perfectly represent the data with relative areas without sacrificing shape preservation.

Thus, noncontiguous cartograms seem to excel at the cartogram’s two main map-reading tasks: shape recognition and area estimation. This is mediated somewhat by the chief advantage of contiguous cartograms: compactness. Because no space is created between enumeration units, contiguous cartogram enumeration units can be larger than those on noncontiguous cartograms, all other things equal. The increased size on contiguous cartograms may improves their legibility.

Read the full entry over at Indie Maps . . .

Early Cartograms (IndieMaps)

Monday, March 2nd, 2009

[Editor's note: Enjoy these examples of early cartograms from Zach Johnson's thesis research.]

Excerpted from IndieMaps.
Originally published there Dec. 8, 2009.

I’m kind of on a cartogram kick lately. I’m interested in the pioneers of the form, those who first thought to distort borders and explode topologies in order to convey the distribution of some thematic variable. When was the first cartogram produced, where, and by whom? I ran into a lot of material while researching my thesis; this post only begins the discussion.


The honor typically goes to Émile Levasseur for the diagrammatic maps contained in his 1868 and 1875 economic geography textbooks.

early diagrammatic map by Levasseur

H. Gray Funkhouser (1937) wrote of these “colored bar graphs”,

squares proportional to the extent of surfaces, population, budget, commerce, merchant marine of the countries of Europe, the squares being grouped about each other in such a manner as to correspond to their geographical position

Interestingly, Waldo Tobler (2004) points out that the example printed by Funkhouser (above) was sized by land area and thus not a true value-by-area cartogram. I don’t have access to Levasseur’s texts, and it’s odd that the only available scan of Levasseur’s first cartogram shows a diagrammatic map, not a true cartogram.


On the other hand is the image below, whose units are definitely sized to the data, but whose geographic arrangement is questionable. I first saw this page from an 1897 Rand McNally Atlas of the World in a SpatialCollective post; a high res version is available from the David Rumsey Map Collection.

a bubble chart, perhaps a circular cartogram, from an 1897 atlas

Circles on the left are sized proportional to population, those on the right to debt. Though the arrangement seems haphazard, geography is not ignored as the circles are grouped together by continent. I don’t really buy these as cartograms, but they’re certainly a predecessor to the circular cartogram form popularized by Danny Dorling nearly 100 years later.

Continue reading at IndieMaps . . .

E00Parser, an ActionScript 3 Parser for the Arc/Info Export Topological GIS Format (IndieMaps)

Monday, March 2nd, 2009

[Editor's note: Zach Johnson promo's his ActionScript 3 class for reading in .e00 GIS files to Flash. Useful for creating cartograms and other graphic representations reliant on topological relationships. Originally posted there Feb. 21, 2009.]

First off, why mess with such a retro format as Arc/Info Export (.e00)?– any code written for this ASCII file type in the last few years has been on how to go from e00 to pretty much anything (especially to the non-topological data format, the shapefile).

Put simply, topological information makes a lot of things possible for the intrepid ActionScripter.

Read more at IndieMaps . . .
Get the code . . .

Nightingale’s roses in ActionScript 3 (indiemaps)

Tuesday, November 11th, 2008

[Editor's note: Zach Johnson demonstrates how to create animated coxcomb charts in Flash/Flex AS3.]

Republished from

[Zach has] long been a sucker for the polar area/coxcomb/rose charts popularized by Florence Nightingale. These multivariate charts can show ordered or unordered categorical data. As noted in an Economist piece on influential information graphics,

As with today’s pie charts, the area of each wedge is proportional to the figure it stands for, but it is the radius of each slice (the distance from the common centre to the outer edge) rather than the angle that is altered to achieve this.

I wanted to produce some just for kicks, so looked around for a script in AS3. No dice. OK, any language? Didn’t see anything. So I sat on the idea for a while and then finally thought up the technique that made producing them in AS3 quite easy. With the resultant classes, producing graphics like the following small multiples of U.S. soldier deaths in Iraq is a snap. The classes are written in AS3, so can be used with Flash, Flex, or mxmlc. All the example screenshots below are PNGs captured from SWFs produced with only AS3 (extended Sprites). To see the code (which includes a lot of ugly annotation), click ‘view source‘ below any image. All source code is included in the ZIP distribution linked below.