Skip to content

stamen/Bay-Area-Blockgroup-API

 
 

Repository files navigation

Bay Area Blockgroup API

This is a modified version of Code for America's US Census Area API that checks only against the US Census block group geometries. During (and possibly after) the US government shutdown, it will be used as a replacement for the FCC's Block Conversion API (cached), which provides data describing which Census areas (including a block-level FIPS code) intersect with a given latitude and longitude.

The original README follows:

US Census Area API

Simple geospatial API for US Census, in response to the Census Area API hack request.

A sample copy with Bay Area Census data can be found at census-api-bay-area.herokuapp.com.

Installing

This is a Flask-based Python application which requires compiled geospatial libraries Shapely and GDAL to run.

Test Locally

  1. Download and unpack sample Bay Area data.
  2. Ensure that datasource.shp and other files are located in the same directory as app.py.
  3. Call python app.py for a test server.

Run Locally with Gunicorn

To run a more robust installation using the Python WSGI HTTP server Gunicorn, prepare local data as in steps 1 & 2 above, then call:

gunicorn app:app

Run on Heroku

Compiled geospatial libraries for Heroku are available via the open source GIS Heroku buildpack. There are two possible ways to run this API on Heroku:

  1. Fork this repository, download and commit your own data as datasource.shp, and push the combined application + data repository to Heroku.

  2. Use the ZIPPED_DATA_URL support in heroku-buildpack-pygeo to configure a remote zip file such as bay-area-data.zip (URL linked above), making sure to install the Heroku plugin user-env-compile. Data will be automatically retrieved and expanded to datasource.shp at compile time.

About

Simple geospatial API for US Census Blockgroups in the SF Bay Area

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 87.0%
  • Shell 12.9%
  • CSS 0.1%