# Graphical cartograms in ArcGIS Pro

By Kenneth Field

Love them or hate them (and people do!), it’s long been a vision of mine to help get cartograms out into the wild. There’s plenty of different flavours of cartogram and of course the ongoing aim is to build tools to support all varieties. We’ve had a Python script knocking around internally for a while that enables us to build two different graphical cartograms which massively helped me in creating the chapter on cartograms in my last book Thematic Mapping. But it’s kinda useless just sat on my hard drive if it’s only me that has the magic power to make them using ArcGIS Pro so here’s the tool, unleashed for you to try out.

Cartograms are used for thematic mapping. They are a particular class of map type where some aspect of the geometry of the map is modified to accommodate the problem caused by perceptually different geographies, such as the different sized areas on most choropleth maps. On choropleths, we have a tendency to see larger areas as more important, regardless of the variable being mapped, and this can cause confusion. Cartograms tackle this by modifying the geography itself, effectively normalizing the geography rather than the data variable to create a map where each area takes on a new shape and/or size based on the variable being mapped. Cartograms therefore depict geographical space diagrammatically as they lose their relationship with true coordinate system geometry.

There are four main types of cartogram which each represent the mapped variable differently – non-contiguous, contiguous, graphical and gridded. I wrote the entry on cartograms for the GIS&T Body of Knowledge if you want to find out more about the wide range of types. The tool here can be used to create two types of graphical cartogram – the Dorling, and the Demers cartograms.

Graphical cartograms effectively create proportional symbols for the data values and then reorganize them in some way to avoid overlaps. The Dorling cartogram is perhaps the most well-known, which uses proportional circles, organized to provide the best adjacency as possible. Here’s a geographical map of the winner of each state for the 2016 Presidential election, followed by a Dorling cartogram showing the same election results but where the size of the symbols are scaled by electoral college votes.

An alternative is the Demers cartogram which uses squares instead of circles and tries to reduce the gaps between shapes. However, whereas the Dorling cartogram attempts to limit the distance of the eventual position of each object from its original position, the Demers sacrifices distance to maintain contiguity as far as possible.

The benefits of graphical cartograms include:

• Converts geography to simple graphic primitives such as circles or squares
• Perceived as a proportional symbol map
• Can be used as a basis for multivariate symbology such as the use of pie charts or Chernoff faces
• Overcomes the problems of overlapping proportional symbols on a geographical map

But there’s also drawbacks which are worth acknowledging:

• Purely diagrammatic with loss of geographic fidelity
• Large gaps can appear between symbols

The tool can be downloaded from here. Add it to the toolboxes in ArcGIS Pro in either the Catalog View or Pane by right-clicking and selecting Add Toolbox. Navigate to wherever you’ve saved the downloaded, unzipped file and it’ll then appear in your Toolboxes.

It works like other tools in ArcGIS Pro. Once you run it, a pane opens where you enter the required parameters for the tool:

Input features: the feature class of the geographical map (that contains the attribute to map)

Output features: the path and filename of the new cartogram feature class being made

Property: the attribute used as a scaling factor for the area of the cartogram symbols

Shape: either a circle for a Dorling cartogram, or a square for a Demers cartogram

Iteration: the number of repetitions of the algorithm to achieve the final cartogram

Ratio: used in the calculation of the combined effect of attraction (> 0, <=1)

Friction: used in the calculation of the combined effect of repulsion (> 0, <=1)

Some of these parameters require a little explanation. The input and output features are self explanatory though it’s worth noting that because the calculations are performed in memory the tool will likely fail if you have very detailed original geometry on your geographical map. Performing some generalization (for instance using the Simplify Polygon tool) might help in this situation.

The property is the attribute you want to make the cartogram from. This is the variable that will be used to proportionally scale the area of the cartogram’s symbols.

The shape is also self explanatory though it’s worth noting that this tool won’t create a true Demers cartogram where contiguity is the primary goal. Instead it uses a version of the Dorling algorithm, but with square symbols. You can use the editing tools to manually move the symbols once created to improve the final look of the cartogram.

The iteration parameter defines how many times the algorithm runs to find the most optimum arrangement of the symbols in the final cartogram. Often a fairly low number will yield reasonable results. As the number of iterations increases so does the overall arrangement in terms of reducing the gaps between symbols but there will come a point, depending on your data where the extra time it takes to run the tool fails to dramatically improve the final result. The default of 400 seems to provide a reasonable balance between speed and quality of the final cartogram.

Ratio and friction are both used during the calculations for determining the location of the symbols. Symbols are first positioned on an areas centroid. From there, forces of attraction, and repulsion, to neighbouring centroids (while taking account of the symbol size) are calculated. These determine a new position for each symbol before the process is repeated according to the number of iterations defined. In all honesty it’s a matter of trial and error with less emphasis placed on the parameter the closer the value is to 0, and more when it gets closer to 1. The defaults of 0.35 and 0.25 tend to work fairly well but just experiment to get the desired result for your dataset.

The result is a cartogram, as a new feature class that occupies broadly the same geographical space as the original map but where geography is replaced by geometrical symbols removed from their original location by differing amounts. It’s therefore important to acknowledge that unlike a map projection there’s no way to apply inverse calculations to return the graphics back to their original geography. It’s basically a graphic that sits in geographical space and can be used like other feature classes.

The cartograms contain a field for the attribute used as the property, and the OID can always be used as a Join Field in relation to the original geography if necessary.

And, of course, once you’ve created your cartogram you can use the new feature class combined with all sorts of other mapping techniques to create interesting versions of the cartogram. Here’s just a few I created for Thematic Mapping which focused on the way in which you can make very different maps of the 2016 Presidential election. Here’s a few examples that use a Dorling cartogram as a basis for making more interesting multivariate thematic maps.

This version of the state map, sized by total votes has used the dot density renderer to symbolize each area with dots representing Republican and Democrat votes which creates a purple mix that tends slightly towards blue for Democratic states, and towards red for Republican states.

Here’s the same basic structure of the Dorling cartogram but symbolized using chart symbology to create embedded pie charts. They’re sized by the same total votes field so they sit flush on the Dorling cartogram scaffold.

If we map counties rather than states we can get more detailed, and in this sense the cartogram reveals how many more counties were Republican, but with a smaller amount of total votes, whereas there were fewer Democratic leaning counties, but which had more votes. This version effectively illustrates the distribution of the US population by size but it demonstrates how a cartogram overcomes the problem of geographical distortion.

And if we use the same value to scale each county then we get a cartogram with the same sized symbols, which can then be used as a structure to be a bit more inventive with the symbology, here using multiple symbology layers driven by attribute connections to build multivariate Chernoff Faces symbology.

This last example takes what might be seen as a simplification of geography by turning real-world geography into geometric shapes, but then applying more complex symbology to encode more detail.

Whatever your choices, cartograms are a pretty useful addition to your thematic mapping armory so enjoy experimenting. Here’s the Graphical Cartogram tool as a download, and don’t forget there’s other tools available such as the coxcomb tool, and waffle grid tool that give you additional thematic mapping options.

Happy cartogramming!