Coder Social home page Coder Social logo

districts's Introduction

United States Districts

GeoJSON and other shape files for the federal legislative districts of the US.

Supported formats:

  • GeoJSON
  • KML

To do:

  • Shapes for state legislative districts
  • TopoJSON

Using the shapes

All files in this repository are automatically published to theunitedstates.io, at predictable URLs.

For example, GeoJSON for New York's 1st district can be found at:

https://theunitedstates.io/districts/cds/2012/NY-1/shape.geojson

The 2012 here refers to the year that these districts came into effect, and is the most current districts. "At Large" districts, where only 1 person represents an entire state or territory, are coded with a district number of 0 (e.g. WY-0 and PR-0).

GeoJSON for the state of New York can be found at:

https://theunitedstates.io/districts/states/NY/shape.geojson

Replace .geojson with .kml to get a KML version of a district.

You can also download the entire set as a ZIP file, and use them however you like. If you plan on using these for heavy traffic, or you want control over the domain name they live on, you should use this method.

Crawling/discovering shape URLs

You can use the Github Repo Contents API to get a quick JSON view of each directory in the repository.

To see a list of all districts in the cds/2012 directory, visit:

https://api.github.com/repos/unitedstates/districts/contents/cds/2012?ref=gh-pages

To see a list of all states in the states directory, visit:

https://api.github.com/repos/unitedstates/districts/contents/states?ref=gh-pages

Other resources

Check out mapshaper for all sorts of helpful map manipulation tools.

These are just static shapes for current districts. If you want to do more, you might use:

Public domain

This project is dedicated to the public domain. As spelled out in CONTRIBUTING:

The project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.

All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.

districts's People

Contributors

dwillis avatar konklone avatar metricmike avatar nickoneill avatar ogtega avatar schwanksta avatar tybritten avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

districts's Issues

Clarify ReadMe on newest data location

In the ReadMe, it says

For example, GeoJSON for New York's 1st district can be found at:

https://theunitedstates.io/districts/cds/2012/NY-1/shape.geojson

The 2012 here refers to the year that these districts came into effect, and is the most current districts. "At Large" districts, where only 1 person represents an entire state or territory, are coded with a district number of 0 (e.g. WY-0 and PR-0).

I expected this to mean that a given year's folder only contained states whose district boundaries were changed in that year. The 2018 folder has only PA, but 2016 has everybody (not just VA, FL, and NC). Which way is intended? Either way, if the "and is the most current districts" line could be clarified to match the expectation, I think that would be good.


If the intention was to avoid data duplication in the repo, here's what I'd suggest: What are the odds that a special directory (now, current, etc.) could be created in cds that contained symlinks to the current map files? It would link to the 2012 districts for NY, to 2016 for FL, and (soon) to 2018 for PA. Then you could drop the states from 2016 who do not have changes and avoid adding everyone (again) to 2018.

Serve combined GeoJSON files?

Wondering if it makes sense to also serve, eg, a single GeoJSON file for all state boundaries together.

(This is just a use-case I've bumped up against time and again, and while GitHub seems like a great platform for geo hosting, I can't seem to find a canonical repo for this. Is this it??? ๐Ÿ˜„ )

Alaska (state) GeoJSON issue

Check out the geojson file for Alaska under State:
ak state

It's different than the one for the At-Large district. I think these should be identical:
screen shot 2018-09-28 at 5 22 11 pm

Non-voting cds GeoJSON files do not have same format as others

The GeoJSON format for all the latest GeoJSON files have a json schema of {"type": "Feature", "properties": {'Code': 'AK-AL', 'District': 'Alaska At-Large'}, "geometry": {"type": "MultiPolygon", "coordinates": [...]} }

However, for non-voting cds, their format is only the dictionary inside the "geometry", i.e. {"type": "MultiPolygon", "coordinates": [...]}. Now, the AK-0 2012 is the same format, but AK 2016 goes with the format above. I think we should update the non voting districts like AS-0. Please let me know if I should directly update the geojson files in 2012 or create a new directory called 2021 that goes with the new format.

more debugging info: Hear-Ye/find-your-district-and-representatives#2 (comment)

Thanks for this awesome repo!

Github Pages doesn't support SSL

Anyone who wants to use these shapes, and to use SSL everywhere, is going to have to host them themselves.

I'll update the README to note this, and to encourage users to write Github support to request SSL support in Github Pages.

2022 House Redistricting updates

These are up-to-date at https://github.com/nickoneill/districts, but they are not all from sources that can be republished CC0. I have a pretty decent workflow for these so I'd like to actually merge 2022 districts when they can be sourced from the census website, but I don't know when that will be.

Feel free to comment here if you get them before I do and I can run my scripts over them to update this repo.

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.