United States Congressional Districts (2012; Census BAS)

Data from United States Census.

Map and API infrastructure based on represent-boundaries (originally by Chicago Tribune/OpenNorth) and represent-maps.

This page demonstrates how to access the GIS API and how to display colorful map layers for the United States Congressional Districts (2012; Census BAS) data hosted here.

Here is the metadata stored with this layer:

Authority: United States Census

Domain: United States

Last Updated: Oct. 19, 2012 (layer) / Oct. 19, 2012 (geography)

Source URL: https://www.census.gov/rdo/data/113th_congressional_and_new_state_legislative_district_plans.html

Creating Maps

This is a demo page for using either Google Maps API v3 or OpenLayers with Open Street Map [Toggle Google/OSM]. View the source to see how it’s done.

Click on the map or hover over the map (Google Maps only) to see what’s there.

View the demo map page for the entire layer.

Using the API

The geospatial information here is modeled in BoundarySets, Boundaries, MapLayers, and MapLayerBoundaries. You are looking at the page for the MapLayer named cd-2012, which is based on the BoundarySet named cd-2012.

BoundarySet

A BoundarySet is a group of geographic regions, like districts or wards.

/boundary-sets
Get metadata for all BoundarySets.
/boundary-sets/cd-2012
Get metadata for one BoundarySet, the one named cd-2012.

The metadata fields of a BoundarySet are largely user-supplied strings.

name_plural Category of boundaries, e.g. "Community Areas".
name_singular Name of a single boundary, e.g. "Community Area".
authority The entity responsible for this data's accuracy, e.g. "City of Chicago".
domain The area that this BoundarySet covers, e.g. "Chicago" or "Illinois".
source_url The url this data was found at, if any.
notes Notes about loading this data, including any transformations that were applied to it.
licence_url The URL to the text of the licence this data is distributed under
last_updated The last time this data was updated from its authority (but not necessarily the date it is current as of).
extent The bounding box of the boundaries in EPSG:4326 projection, as a list such as [xmin, ymin, xmax, ymax]. (Optional.)

Boundary

A Boundary is a single district. It is stored as a MultiPolygon internally, which means the district may be made up of multiple geographically disjoint parts. All coordinates are in the WGS 84 (EPSG:4326) spatial reference system.

/boundaries
Get metadata for all Boundary records, in all BoundarySets.
/boundaries/cd-2012
Get metadata for all Boundary records in a particular BoundarySet, here the cd-2012 BoundarySet.
/boundaries/cd-2012/nc-02
Get metadata for a particular Boundary — here the nc-02 Boundary in the cd-2012 BoundarySet.
/boundaries/cd-2012/?contains=35.446,-79.299
Find Boundaries that contain a given lat/lng coordiate.
/boundaries/cd-2012/?touches=cd-2012/nc-02
Find Boundaries in a particular BoundarySet that touch a given Boundary (named by the BoundarySet and Boundary slugs). Leave out the BoundarySet in the path part of the URL (see the intersects example next) to search across all BoundarySets.
/boundaries/?intersects=cd-2012/nc-02
Find Boundaries across the whole database that intersects a given Boundary (named by the BoundarySet and Boundary slugs). Specify a BoundarySet slug in the path part of the URL (see the touches example above) to search in a particular BoundarySet.
/boundaries/cd-2012/nc-02/shape?format=wkt
Get the actual shape of a Boundary — here in WTK format for the nc-02 Boundary in the cd-2012 BoundarySet. You will always get back a MultiPolygon. You may also specify format=json or format=kml.
/boundaries/cd-2012/nc-02/simple_shape?format=wkt
Same as above but retrieves simplified geometry. The degree of simplification depends on site settings but the default is to eliminate features smaller than 0.0002 of a degree.

The metadata fields of a Boundary are:

boundary_set_name Category of boundaries that this boundary belongs, e.g. "Community Areas".
name The name of this boundary, e.g. "Austin".
metadata The complete contents of the attribute table for this boundary from the source shapefile, structured as json.
external_id The boundaries' unique id in the source dataset, or a generated one.
extent The bounding box of the boundary in EPSG:4326 projection, as a list such as [xmin, ymin, xmax, ymax]. (Optional.)
centroid The centroid (weighted center) of this boundary in EPSG:4326 projection. (Optional.)

MapLayer/MapLayerBoundary

There is no API for MapLayers and MapLayerBoundaries at this time.