Back to Mapbox elections

2004-2016 presidential elections tilesets

Ready-to-build tilesets containing US presidential general election returns and demographic data from 2004 to 2016, powered by Mapbox Boundaries.

One way to understand a country is to go beyond individual election results to explore trends and changes throughout the years. To support this type of electoral analysis, we’ve created these tilesets which span the last four presidential elections and use geometries from Mapbox Boundaries to visualize returns and population data at both the county and state levels. This data is available to all users as default tilesets via the tileset page or the Studio interface.

What’s in the tilesets?

We’ve created two pairs of tilesets showcasing results by states and by counties respectively. Each pair includes the shapes’ polygons and points for each level. Each feature in the tileset has an id that corresponds to the state or county FIPS code converted to an integer. For example, the FIPS code for Alameda county in California is 06001 so that id would be 6001.

County tileset

The county tileset contains the following properties for the years 2004, 2008, 2012, 2016:

Property Description Type
FIPS County unique identifier integer
name County name string
state_abbrev State postal code string
land_area_km2 Surface area in km2 integer
{year}_pop_count Population count integer
{year}_total_votes Total votes integer
{year}_winner "dem"/"rep" string
{year}_mov_count Margin of victory - count integer
{year}_mov_pct Margin of victory - percentage integer
{year}_dem_count Vote count for democratic candidate integer
{year}_rep_count Vote count for republican candidate integer
{year}_oth_count Vote count for other candidate integer
{year}_dem_pct Vote percentage for democratic candidate integer
{year}_rep_pct Vote percentage for republican candidate integer
{year}_oth_pct Vote percentage for other candidates integer


State tileset

The state tileset contains the following properties for the years 2004, 2008, 2012, 2016:

Property Description Type
FIPS State unique identifier integer
name State name string
state_abbrev State postal code string
land_area_km2 Surface area in km2 integer
{year}_pop_count Population count integer
{year}_total_votes Total votes integer
{year}_winner "dem"/"rep" string
{year}_mov_count Margin of victory - count integer
{year}_mov_pct Margin of victory - percentage integer
{year}_dem_count Vote count for democratic candidate integer
{year}_rep_count Vote count for republican candidate integer
{year}_oth_count Vote count for other candidate integer
{year}_dem_pct Vote percentage for democratic candidate integer
{year}_rep_pct Vote percentage for republican candidate integer
{year}_oth_pct Vote percentage for other candidates integer


About the data

The shapes for counties and states are powered by Mapbox Boundaries. The county presidential returns for 2004, 2008, 2012, and 2016 are sourced from the MIT Election Data and Science Lab's "County Presidential Elections Returns 2000-2016."

The population data was pulled from the US Census Population Estimates Program. The source file for 2004 and 2008 can be found here and the source file for 2012 and 2016 can be found here.

The state voter turnout data for 2004, 2008, 2012, and 2016 is from The United States Elections Project by Michael P.  McDonald, available under a CC-BY with exception license, and was accessed on January, 23rd 2020. Land area for each county and state are from the US Census 2019 TIGER counties shapefile.

Technical details

To use the tileset, you will need a Mapbox account. You can:  

Example

In the following map, we’re showcasing the data available in the tileset using our Storytelling Template. Remix this yourself on Glitch.