How To Make Area Cartogram Maps in ArcGIS

Share:

  

If you have data with disparate values between areas, making an area cartogram is an effective way to map out those values.  Unfortunately, making area cartogram maps within ArcGIS can’t been done natively so external scripts and programs are needed.  In this article, I review one ToolBox that is available from Esri’s Arcscript’s site called the Cartogram Geoprocessing Tool version 2 that will create cartograms from GIS data.  The example below is generated from a dataset of numbers of billionaires that reside in each state within the United States.  Since the number of billionaires is uneven within each state (there is a disproportionate amount that live in California, New York, Texas, and Florida) this dataset works well for creating cartograms.

The original data can be visualized as a simple choropleth map:

Choropleth map showing the number of billionaires in residence per state for the United States.  Data from Forbes' List of the World's Billionaires, March 2012.

Choropleth map showing the number of billionaires in residence per state for the United States. Data from Forbes’ List of the World’s Billionaires, March 2012.

More information about this dataset and the analysis of billionaires can be found in this article: Geography of Billionaires: Total Counts of the World’s Billionaires by Country for Residency and Citizenship, and by City.

If you want to make a contiguous cartogram, the easiest way is to download Tom Gross’ Cartogram Geoprocessing Tool that uses the Gastner/Newman diffusion-based algorithm to produce a geodatabase.  To install, download and uninstall the .zip file into a folder (pick the default c:\arcscript’s folder for convenience’s sake).  Within  ArcGIS, click on the toolbox icon and then right click on the ArcToolBox name and select “add toolbox”.  Migrate to the folder where you installed the carogram folder and find the cartogram toolbox.  Select the cartogram toolbox and hit “add”.  The cartogram toolbox will now show up on your list of toolboxes.

Adding in custom toolboxes to ArcGIS: (1) Click on the Toolbox icon from the menu bar. (2) Right click on ArcToolBox. (3) Migrate to the folder where the toolbox is stored and select to add.

Adding in custom toolboxes to ArcGIS: (1) Click on the Toolbox icon from the menu bar. (2) Right click on ArcToolBox. (3) Migrate to the folder where the toolbox is stored and select to add.

The cartogram script from Gastner also comes with sample data that you can experiment with if you don’t have your own.  To create a cartogam, load in a GIS file either of the world, or of a country with subareas (such as a layer of the United States with individual polygons for the states).  The GIS file must have one field with quantitative data (such as a column with population numbers) in order to generate a cartogram.  For my example, I am going to load in a shapefile of the United States with value counts for the number of billionaires living within each state.

Once the GIS layer is loaded, then click on the cartogram toobox to bring up the cartogram processing window.  From the dropdown select the GIS dataset you will use and then select the field with the quantitative data you will use to generate the cartogram.  The cartogram output is created as a geodatabase so you will need to designate an existing geodatabase or choose the default.gdb if you don’t have one.  I recommend having a unique ID field in your original database that you will designate to be added to the cartogram geodatabase.  This will allow you to join the attribute data from the original area file to the cartogram so you can bring over qualitative data such as the state names (in order to label your new area cartogram map).

Cartogram GUI.

Cartogram GUI.

Depending on the size of the GIS data used, the cartogram will take at least a few minutes to generate.  Once the cartogram has been generated, it will automatically be added to your ArcGIS document.  Once it has been added, you can then modify the properties such as assigning gradient values for creating a choropleth map and labeling.

The finished cartogram of billionaires living within the United States:

Cartogram map showing the number of billionaires in residence by state within the United States. Click on image for a larger map.

Cartogram map showing the number of billionaires in residence by state within the United States. Click on image for a larger map.

The cartogram Toolbox only allows for the creation of contiguous cartograms.  Unfortunately, there doesn’t seem to be any current resources available for generating non-contiguous or Dorling cartograms from within the latest versions of ArcGIS.  There are however, legacy tools for previous generations of ArcGIS that use Visual Basic and Avenue scripts for ArcView 3.x that are available.  MAPresso, a standalone Java applet that can create non-contiguous cartograms with an export option for ArcGIS compatible files, seems like it might be an option but the site (which was functional a couple of weeks ago) now is defunct.

Tips for Using the Cartogram Geoprocessing Tool

Tom Gross, who developed the Cartogram Geoprocessing Tool offers some tips and hints about working with the tool:

You can increase the size of the Analysis Mesh if you want to be sure to pick up polygons that are very small, such as D.C. on the U.S. map and Singapore on the world map.  I often add other layers, like cities, as additional features to transform.  It’s a good idea to use an equal area projection.  If you have ArcGIS 10, you should register the .dlls for all the GP Tools using esriRegasm.exe.  Don’t try to use the Cartogram tool as a background process, which is an option in 10.0.

Some hints about making cartograms on a worldwide dataset:

I think having an ArcGIS license gets you access to Esri Data and Maps.  The Esri Data and Maps worldwide data are compressed shapefiles in WGS84 decimal degrees.  It’s a good thing to have data for cartograms in an equal area projection.  It’s also good to put the data into a Feature Dataset in a File Geodatabase.  Equal area projections of worldwide data are not very visually appealing, but I’ve found that Mollweide, Sphere Ekert IV, or Goode Homolosine are not too bad.  Yes, the cartogram tool works just fine with the Goode Homolosine projection.  The cartogram algorithm doesn’t care about interrupted combination projections, it just wants numbers to transform.

A Feature Dataset will define the same Spatial Reference (including the projection) for all the Feature Classes contained.  It will also define a common coordinate domain, which is essentially a huge expanse of integer coordinates.  The double precision floating point coordinates of the Feature Classes in the Feature Dataset will snap to the integer coordinates of the domain.  Two integer coordinates can be compared for equality, whereas two floating point coordinates can never be expected to be equal.  The integer coordinate domain allows efficient spatial queries, and eliminates the positional fuzziness of floating point coordinates.  The problem for cartograms arises because the default location of the coordinates of a projected Feature Class begin near the lower left corner of the coordinate domain.  Sometimes the distortion of the cartogram causes transformed coordinates to fall outside the left and bottom edges of the coordinate domain.  When that happens the polygon (usually Antarctica) will not be written into the cartogram Feature Class.

Here is the hint (trick) for avoiding the coordinate domain problem – get the Spatial Reference coordinates to be placed in the middle of the coordinate domain, not the lower left corner.  To do so, just specify the XY Coordinate System to be “Unknown” when defining the Feature Dataset.  Take the defaults for Domain, Resolution and Tolerance.  After the empty Feature Dataset is written into the File Geodatabase, open its Feature Dataset Properties, and pick the XY Coordinate System you really want.  I’d also suggest making the Linear Units be Kilometers.  The default Resolution and Tolerance will be changed to reflect the XY Coordinate System.

This trick does not have to be used for continental or larger scale projections, only worldwide projections.

 



Like this article and want more?

Enter your email to receive the weekly GIS Lounge newsletter: