freddiemixell / us-zipcodes-congress-inspector

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 2020 Census tabulation blocks, which includes redistricting for the 118th Congress as submitted on December 16, 2022. We match these to zipcodes through the ZCTA relationship. We de-duplicate these, ensuring not to alter ZCTAs that span state lines. We also clean them, to remove unsightly null strings, and rename at-large districts from 98 to 0.

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 2020. 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

License:Other


Languages

Language:Python 69.9%Language:HTML 13.4%Language:CSS 9.8%Language:Makefile 6.9%