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://boundaries.tribapps.com/1.0/boundary-set/schema/

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

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

A single BoundarySet may be accessed directly by its slug:

http://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://boundaries.tribapps.com/1.0/boundary/

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

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

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

http://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://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://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://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://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://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://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://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 minute per IP address. This throttling is in place in order to ensure that it can be scaled to meet demand without extensive outages.

We do not recommend using the API for production applications. This is a free service and we offer no guarantees of uptime, support or response time in the case of a problem. We may, at any time, block certain clients or change the thresholds for throttling.

If you intend to build an application which will query the API, please e-mail us. In the event of any issues or changes to the boundary service we can contact you.