Skip to content

zqh375/us-zipcodes-congress

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

US Zipcodes to Congressional Districts

Mapping between US zipcode tabulation areas and Federal Congressional districts.

Why is this necessary?

There are many commercial sources of zipcode data available, and some of them include congressional representatives. There are also several APIs to look up a congressperson based on an address, or a lat/lon point. However, phone based contact methods like CallPower require a fast and free way to match a person to their rep, ideally without requiring them to type in a full address. Thus, we still need zipcodes.

Caveats

  • Zipcodes are not area designations, they are linear routes designed for mail delivery. The US Census delineates boundaries with the most frequently used zipcode within an tract area, but they have not released an official zipcode to ZCTA map since 2000.
  • Census ZCTAs are not an exact match to USPS zipcodes, because they are not produced for lightly populated areas. However 'in most instances the ZCTA code is the same as the ZIP Code for an area.' US Census, 2015
  • In 2000, the ZCTA delineation process excluded 10,068 ZIP codes, including 2,523 ZIP Codes that served specific companies or organizations with high volumes of mail and 6,419 ZIP Codes dedicated to Post Office (PO) Box and/or general delivery addresses. ASDC 2010
  • ZCTAs may span states and congressional districts. 'Nearly 15 percent of all ZIP codes cross congressional district boundaries.' ZipInfo 'There are 153 ZIP Codes in more than one state.' US Census, 1994
  • If you have the ability to look up districts from a full address or zip+4, you should. If you are still interested in matching zipcode to US Congressional District, read on.

How does this work?

We start with the most recent Census mapping for the 115th Congress, which includes redistricting in 2016 for FL, MN, NC and VA. It does not however include data for states and territories with at-large representation (AK, DE, MT, ND, SD, VT, WY, PR, and DC). We add all available ZCTAs for those states as well at the US Minor Outlying Islands, using 2010 data. This is unfortunately the latest available. We de-duplicate this data, ensuring not to alter ZCTAs that span state lines. We also clean it, to remove unsightly null strings, and obviously incorrect values in Colorado that start with 000.

We are left with a reasonably clean dataset. When tested against older publically available ones from the Sunlight Foundation (RIP) and 18F, we show that we are not missing any ZCTAs, and have updated 1079 out of 39435 to new congressional districts. Run make test to see exact changes.

We have also included a crosswalk file sourced from HUD, parsed from Excel and split to match the format of the above file. This may be more complete, as it is derived from in the quarterly USPS Vacancy Data and last updated in September 2018. It is available only for government entities and non-profit organizations related to the "stated purpose" of the HUD Sublicensing Agreement (measuring and forecasting neighborhood changes, assessing neighborhood needs, and measuring/assessing various HUD programs).

Data Sources

More about ZIP codes and ZCTA

About

Mapping of US zipcodes to Congressional Districts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 86.0%
  • Makefile 14.0%