King County Election Atlas

A comprehensive database of electoral data

Introduction

The Election Atlas of King County is a comprehensive database of current and historical election results in King County, Washington. It organizes 15 years and 20 million rows of detailed results data, along with an apparatus of spatial data for analyzing, querying, and visualizing those results. The purpose of the project is to have cleaned and normalized historical data available for analysis that is timely and responsive to new questions in its domain and capable of illuminating old questions that simpler models aren’t able to address. The Atlas relies on PostGIS, QGIS, and R.

Election results data format

Figure 1: Raw csv for single election

The machine that counts ballots for the King County Department of Elections regards each observation of a vote for a candidate or a contest left blank on a given ballot as a distinct event. The reports generated and made public tabulates those observations by the precincts–county defined voting areas–from which ballots have been cast. Ballots themselves are anonymous, but they are marked, grouped, and counted by precinct. Each row of the county data file represents the number of times an indicated phenomenon was observed on ballots from an indicated precinct.

Figure 1 contains the first few lines of one election results file, and shows the number of votes counted for each of the candidates listed under “CounterType” for the Attorney General’s race in the precinct of ADAIR. This database combines dozens of elections’ results files into a single results table, and a series of other tables for accessing it and filtering it. Since 2015, precinct-level results have been released both for the counts announced on election night, typically about half the vote, and for the final official result. This contains both counts for elections where it is available.

Hexagons

Hexagons can be used to both translate between precinct layers that are analagous but whose polygons have changed, as well as restrict symbology to areas on the map where the phenomenon is actually occuring–in this case on residential parcels.

Precinct geography

Parcel geography: each precinct’s area is represented as the area of the parcels it overlaps.

Grid of hexagons samples parcel layer and data is allocated to each hex based on the shares of parcel-precinct areas it contains.

Hexagons displaying sampled data

A few key tables
  • results Each row represents an individual counting event, which includes a vote for a candidate or ballot measure, leaving a contest blank, or voting for too many candidates. Ballots are anonymous, but do indicate the precinct from which they are being cast. This table indicates the number of votes for a candidate or measure in each precinct..
  • parcels Parcel boundaries are used to define the areas where people live and are casting their votes. Parcel data is also used to classify these sources of votes by characteristics including land use.
  • candidates Candidates (Derived from results)
  • bm Ballot measures: year, jursidiction (Derived from results)
  • bm_options Ballot measure options (“YES”,“NO”,“Approved”) (Derived from results)
  • contests Candidate contests with year, election, jurisdiction, office (Derived from results)