Outside Illinois? Go to Tribune Tower or drag the pin on the map!

You are here.

Waiting for browser ...

Introduction

The Boundary Service API provides a restful interface to a wealth of data about official geographic boundaries within Illinois. Data is retrieved from the API as JSON (optionally JSONP) with nested GeoJSON for describing the boundary shapes.

There are two resources described by the API: Boundary Sets and Boundaries.

Boundary Sets

Boundary Sets describe the extent and provenance of a group of Boundaries as well how recently they were last updated. Here, for example, is the Boundary Set for census tracts:

{
    authority: "U.S. Census Bureau",
    boundaries: [
        "/1.0/boundary/census-tract-1-7/",
        "/1.0/boundary/census-tract-1-9/",
        "/1.0/boundary/census-tract-1/",
        "/1.0/boundary/census-tract-1-8/",
        ...
    ],
    count: 3123,
    domain: "Illinois",
    href: "http://www.census.gov/cgi-bin/geo/shapefiles2010/main",
    last_updated: "2011-01-08",
    metadata_fields: [
        "STATEFP10",
        "COUNTYFP10",
        "TRACTCE10",
        "GEOID10",
        "NAME10",
        "NAMELSAD10",
        "MTFCC10",
        "FUNCSTAT10",
        "ALAND10",
        "AWATER10",
        "INTPTLAT10",
        "INTPTLON10"
    ],
    name: "Census Tracts",
    notes: "Shapes used for 2010 census.",
    resource_uri: "/1.0/boundary-set/census-tracts/",
    slug: "census-tracts"
}

Descriptions of all the properties of a Boundary Set can be accessed at:

http://api.boundaries.tribapps.com/1.0/boundary-set/schema/

To see a paginated list of available Boundary Sets access the following url:

http://api.boundaries.tribapps.com/1.0/boundary-set/

A single BoundarySet may be accessed directly by its slug:

http://api.boundaries.tribapps.com/1.0/boundary-set/community-areas/

Boundaries

Boundaries are the individual shapes within a Boundary Set. The Boundary for A-C Central Community Unit School District 262 looks like:

{
    centroid: {
        coordinates: [
            -90.084528
            39.952622
        ],
        type: "Point"
    }
    external_id: "00105",
    kind: "Unified School District",
    metadata: {
        ALAND: 377198165,
        AWATER: 1185357,
        FUNCSTAT: "E",
        HIGRADE: "12",
        INTPTLAT: "+39.8619840",
        INTPTLON: "-090.0553779",
        LOGRADE: "PK",
        LSAD: "00",
        MTFCC: "G5420",
        NAME: "A-C Central Community Unit School District 262",
        SDTYP: "",
        STATEFP: "17",
        STATENS: "01779784",
        UNSDIDFP: "1700105",
        UNSDLEA: "00105"
    },
    name: "A-C Central Community Unit School District 262",
    resource_uri: "/1.0/boundary/a-c-central-community-unit-school-district-262-unified-school-district/",
    set: "/1.0/boundary-set/unified-school-districts/",
    simple_shape: {
    coordinates: [
        [
            [
                [
                    -89.9756,
                    39.886457
                ],
                [
                    -89.975954,
                    39.836324
                ]
                ...
            ]
        ],
        type: "MultiPolygon"
    },
    slug: "a-c-central-community-unit-school-district-262-unified-school-district"
}

Resources representing individual Boundaries can be accessed at:

http://api.boundaries.tribapps.com/1.0/boundary/

As with Boundary Sets a description of all properties returned with the Boundary can be retrieved from:

http://api.boundaries.tribapps.com/1.0/boundary/schema/

And a single Boundary may be accessed directly by its slug:

http://api.boundaries.tribapps.com/1.0/boundary/austin-community-area/

For ease of url construction a Boundary may also be referenced by appending the Boundary's external_id property to it's parent BoundarySet's uri. Example:

http://api.boundaries.tribapps.com/1.0/boundary-set/wards/22

This returns the 22nd Chicago city ward.

Note: The metadata fields returned with a Boundary are taken directly from the relevant data sources. In certain cases these are known to be out-dated. An effort has been made to capture such issues in the BoundarySet's notes property, but these values should generally not be taken at face value.

Limiting resources returned

Pagination of returned resources is handled with the limit and offset parameters:

http://api.boundaries.tribapps.com/1.0/boundary/?limit=10&offset=10

In addition, queries may (and should) be constrained by passing a comma-delimited list of BoundarySet slugs to the sets parameter:

http://api.boundaries.tribapps.com/1.0/boundary/?sets=community-areas,neighborhoods

Point queries

The fundamental query exposed by the Boundary Service is a point-in-polygon search by latitude and longitude. Here is an example:

http://api.boundaries.tribapps.com/1.0/boundary/?contains=41.8903239,-87.623458&sets=community-areas

This will return the community area that Tribune Tower resides in, the Near North Side.

Note: In addition to the contains parameter we also pass the sets parameter to constrain the query. Its important to use this parameter to limit your queries to only the data you need so your queries will be performant.

Near queries

The near query finds all Boundaries that intersect a circle of a specified radius using a given point as its center:

http://api.boundaries.tribapps.com/1.0/boundary/?near=41.8903239,-87.623458,1mi&sets=wards

This returns all wards within one mile of Tribune Tower. The radius parameter may be specified in any units supported by GeoDjango.

Note: This query will execute more slowly than the point query.

Intersection queries

The intersects query finds all Boundaries which intersect a specified Boundary. For example, to find all neighborhoods which intersect the Humbolt Park Community Area, one would request:

http://api.boundaries.tribapps.com/1.0/boundary/?intersects=humboldt-park-community-area&sets=neighborhoods

The Boundary Service does not currently support querying by arbitrary shapes.

JSONP

For use in client-side applications the Boundary Service API may be accessed via JSONP. Simply append the format and callback parameters to the query string:

http://api.boundaries.tribapps.com/1.0/boundary/?format=jsonp&callback=func

Throttling & API keys

The Boundary Service API can be accessed anonymously up to 100 times per hour per IP address. This throttling is in place in order to ensure that it can be scaled to meet demand without extensive outages. If you intend to build an application which will query the API in bulk, please e-mail us your requested username and we will provide you with an API key that allows unlimited access. This implementation will allow us to take appropriate action in the event that a single source of the traffic is causing the service to be unstable.

An API key can be used as follows:

http://api.boundaries.tribapps.com/1.0/boundary/?username=example_user&api_key=3b7b288ca1f9d90bef69c3eb4d880184f84ff740

Build your own boundary service!

The source code for the boundary service is hosted on Github. If you decide to host a public boundary service for your region, please let us know! We are also very happy to accept bug reports and patches!

https://github.com/newsapps/boundaryservice

License

All source and assets are licensed under the permissive MIT license. Full text follows:

The MIT License

Copyright (c) 2011 Chicago Tribune, Christopher Groskopf, Ryan Nagle

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

The Chicago Boundary Service is a project created of the News Applications team at the Chicago Tribune. The primary developers are Christopher Groskopf and Ryan Nagle.

We present the service to the community in the hope it will foster development of informative, investigative and civically minded applications amongst Illinois developers.

Open Source

This boundary service would not be possible without incredible open-source tools including Python, Django, Tastypie, Postgres and Varnish.

Special thanks to Justin Bronn, contributor of the Geodjango extensions to Django and to Daniel Lindsley, lead developer of django-tastypie.

Open Data

The data for this project was acquired from a variety of city, county, state and federal agencies. Documentation of exactly how and where the data was retrieved is available by accessing any Boundary Set via the API. Examples can be found on the API page.

If you know of additional data that should be included in this site, email us.

Contact

Comments / Questions? Email us at newsapps@tribune.com