GithubHelp home page GithubHelp logo

thebarton / us-zipcodes-congress Goto Github PK

View Code? Open in Web Editor NEW

This project forked from opensourceactivismtech/us-zipcodes-congress

0.0 0.0 0.0 1.53 MB

Mapping of US zipcodes to Congressional Districts

License: Other

Python 89.12% Makefile 10.88%

us-zipcodes-congress's Introduction

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

us-zipcodes-congress's People

Contributors

jlev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.