Outside Smith County, TX? Jump to Tyler Public Library or drag the pin on the map!

Smith County Boundaries

Waiting for browser ...

Introduction

The Boundary Service API provides a restful interface to a wealth of data about official geographic boundaries within Smith County. 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 Tyler City Council Districts:

{
    authority: "Tyler GIS Department"
    boundaries: [
        "/1.0/boundary/central-city-council-district/"
        "/1.0/boundary/east-city-council-district/"
        "/1.0/boundary/northeast-city-council-district/"
        "/1.0/boundary/northwest-city-council-district/"
        "/1.0/boundary/south-city-council-district/"
        "/1.0/boundary/west-city-council-district/"
    ]
    count: 6
    domain: "Tyler"
    href: "http://www.smithcountymapsite.org/webshare/data.html"
    last_updated: "2011-05-14"
    metadata_fields: [
        "DISTRICT"
        "NAME"
        "REP"
        "SHAPE_STAr"
        "SHAPE_STLe"
    ]
    name: "City Council Districts"
    notes: ""
    resource_uri: "/1.0/boundary-set/city-council-districts/"
    slug: "city-council-districts"
}

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

http:///1.0/boundary-set/

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

http:///1.0/boundary-set/schema/

A single Boundary Set may be accessed directly by its slug:

http:///1.0/boundary-set/city-council-districts/

Boundaries

Boundaries are the individual shapes within a Boundary Set. The Boundary for Tyler's Central City Council District looks like:

{
    centroid: {
        coordinates: [
            -95.319192
            32.276927
        ]
        type: "Point"
    }
    external_id: "1"
    kind: "City Council District"
    metadata: {
        DISTRICT: "1"
        NAME: "CENTRAL"
        REP: "Sam Mezayek"
        SHAPE_STAr: 264373899.847
        SHAPE_STLe: 92241.0919277
    }
    name: "CENTRAL"
    resource_uri: "/1.0/boundary/central-city-council-district/"
    set: "/1.0/boundary-set/city-council-districts/"
        simple_shape: {
        coordinates: [ … ]
        type: "MultiPolygon"
    }
slug: "central-city-council-district"
}

A paginated list of all Boundaries can be accessed at:

http:///1.0/boundary/

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

http:///1.0/boundary/schema/

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

http:///1.0/boundary/central-city-council-district/

For ease of url construction a Boundary may also be referenced by appending the Boundary's external_id property to it's parent Boundary Set's URL. For example:

http:///1.0/boundary-set/city-council-districts/2

Note: The metadata fields returned with a Boundary are taken directly from the original data sources. In certain cases these may be out of date. An effort has been made to capture such issues in the Boundary Set'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:///1.0/boundary/?limit=10&offset=10

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

http:///1.0/boundary/?sets=city-council-districts,justice-of-the-peace-precincts

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:///1.0/boundary/?contains=32.349549,-95.301829&sets=city-council-districts

This will return the City Council District that Tyler Public Library resides in.

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 fast.

Near queries

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

http:///1.0/boundary/?near=32.349549,-95.301829,1mi&sets=wards

This returns all wards within one mile of Tyler Public Library. 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 Justice of the Peace Precincts which intersect the Central City Council District, one would request:

http:///1.0/boundary/?intersects=central-city-council-district&sets=justice-of-the-peace-precincts

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:///1.0/boundary/?format=jsonp&callback=func

Build your own boundary service!

The source code for this Boundary Service instance is hosted on Github. You are welcome to copy, modify and reuse it as you see fit. We are also very happy to accept bug reports and patches!

https://github.com/hacktyler/hacktyler-boundaryservice

License

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

The MIT License

Copyright (c) 2011 Christopher Groskopf

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 Smith County Boundary Service instance is a Hack Tyler project created by Christopher Groskopf The Boundary Service software is a product of the News Applications team at the Chicago Tribune.

This API is provided as a free service for the community.

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, please leave a comment on the Hack Tyler Data Sources page.

Contact

Comments / Questions? Chris is on Twitter.