Every four years in the United States, we are made to go through one of the most exciting, political theaters in the world: the US Presidential Elections. At every twist and turn of the build up towards the eventual outcome, there is one mode of communication that links everybody, whether they are in blue states or red states, and that is that we all communicate and are transfixed by the real-time, digital maps of the evolving results.
The following tutorial is an introduction to the basic concepts of GIS, using this exciting medium, the election data, as a basis of teaching about spatial data, joining data to the relevant geographic scales, and styling the maps to create compelling election maps, just like the ones we have all seen on CNN and other major news outlets.
Step 1: The Data
This tutorial presumes that the election data has been compiled for you in a nicely formatted Excel table (keep in mind that data is rarely “handed over” in such a user friendly format!).
Download the data link above, and unzip in your local drive. You should see the following files:
Open the 2012PrezData.xls file, and inspect its contents. What data fields are there? How do you propose to use this data on a map? Close excel, and launch ArcMap.
Step 2: ArcMap
- Open ArcMap, and accept a “blank” project
- Go to File, Add Data, Add Data
- Navigate to the 2012PrezData.xls file that you downloaded, and double click on it. Select “Sheet1$prez” and click on “Add“
- Right click on Sheet1$prez from the table of content, and “Open“
- Inspect the table, and ensure that the content has an “ObamaMargin” and “FIPS” column
- Go to File, Add Data, Add Data again
- Navigate to the root folder of the downloaded data, and add “counties.shp“. You map canvas should now show a map of US Counties.
Step 3: Joining data
You have now loaded tabular data (election results), and a county geographic layer to your project. However, these two datasets are not “linked”, or “joined” yet, which means that they do not relate to each other in any way. In order to allow the election data to be mapped, it will have to be joined to the county later.
- Right click on the “counties” layer from the table of contents
- Go to Joins and relates, Join…
- In the popup window,
- Click “OK“
- Right click on “counties” and “Open Attribute Table“
- Inspect the table, scroll to the right, and make sure that you see the “ObamaMargin” column
Step 4: Make a pretty map
- Right click on “counties” and go to “properties“
- Select the “Symbology” tab
- Highlight “Quantities“, “Graduated Colors“
- For “Value“, select “ObamaMargin“
- For Color Ramp, choose this one:
- For Classification, choose 6 classes, and click the “Classify” button
- Modify the numbers under “Break Values” with the following:
- Click “OK“
- We want to switch the colors (Obama is blue after all). Left click on the header above the color patches “Symbol“, and “Flip Symbols“
- Let’s also make the county outlines white, instead of black. Left click on the header again, and select “Properties for all symbols…“
- Change the “Outline color” to white
- Click “OK” twice
Step 5: Final touch up
- Let’s change the projection to a US friendly one. Right click on “Layers” from the table of contents, and go to Properties
- Select the “Coordinate Systems” tab
- Expand “Projected Coordinate Systems“, “Continental“, “North America” and select “US National Atlas Equal Area“
- Finally let’s add the State layer. Go to File, Add data, Add data, and add “states.shp“
- Right click on states, and go to Properties. Select the Symbology tab, and click on the symbol patch (the big colored rectangle)
- For “Fill color“, choose “No color“
- Click Ok twice
Inspect the map. What does it tell you? Is it revealing? Is it misleading? Most importantly… does it communicate its intent effectively? Show it around, and discuss with your fiends and colleagues!