• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

codeforamerica/US-Census-Area-API: Simple geospatial API for US Census, see also ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

codeforamerica/US-Census-Area-API

开源软件地址:

https://github.com/codeforamerica/US-Census-Area-API

开源编程语言:

Python 90.5%

开源软件介绍:

US Census Area API

Simple geospatial API for U.S. Census and other data sources, in response to the Census Area API hack request.

This application can be run in two distinct ways. When the environment variable GEO_DATASOURCE=http://forever.codeforamerica.org/Census-API/ is present, the API will serve nationwide U.S. Census geographies from the state to block level. See this in action at census.codeforamerica.org and use it freely.

Otherwise, it will use a local OGR-compatible datasource such as a shapefile or GeoJSON to serve any data and make it available for download. 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. Directions here assume that you have an OGR-compatible datasource you’d like to use.

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. Create a new Heroku app with this buildpack:

heroku create --buildpack https://github.com/codeforamerica/heroku-buildpack-pygeo

There are two possible ways to run the 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.

Credits

Written by Michal Migurski with Andy Hull, (c) 2013 Code for America. See LICENSE for license information.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
octobanana/stig: A CLI tool for searching GitHub from the terminal.发布时间:2022-06-11
下一篇:
Push API发布时间:2022-06-11
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap