Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

pygeoapi provides an API to geospatial data

Project description

Build Status

pygeoapi provides an API to geospatial data


virtualenv -p python pygeoapi
cd pygeoapi
. bin/activate
git clone
cd pygeoapi
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install -e .
cp pygeoapi-config.yml local.config.yml
vi local.config.yml
# TODO: what is most important to edit?
export PYGEOAPI_CONFIG=/path/to/local.config.yml
# generate OpenAPI Document
pygeoapi generate-openapi-document -c local.config.yml > openapi.yml
export PYGEOAPI_OPENAPI=/path/to/openapi.yml
pygeoapi serve

Example requests

Try the swagger ui at http://localhost:5000/ui


# feature collection metadata
curl http://localhost:5000/
# conformance
curl http://localhost:5000/conformance
# feature collection
curl http://localhost:5000/collections/countries
# feature collection limit 100
curl http://localhost:5000/collections/countries/items?limit=100
# feature
curl http://localhost:5000/collections/countries/items/1
# number of hits
curl http://localhost:5000/collections/countries/items?resulttype=hits

Exploring with Swagger UI

docker pull swaggerapi/swagger-ui
docker run -p 80:8080 swaggerapi/swagger-ui
# go to http://localhost
# enter http://localhost:5000/api and click 'Explore'

Demo Server

There is a demo server on running the latest (Docker) version from the master branch of this repo. pygeoapi runs there at

The demo server setup and config is maintained within a seperate GH repo:


Best/easiest way to run pygeoapi is to use Docker. On DockerHub pygeoapi Docker Images are available.

The version tagged latest is automatically built whenever code in the master branch of this GitHub repo changes (autobuild). This also cascades to updating the pygeoapi demo service. So the chain is:

(git push to master) --> (DockerHub Image autobuild) --> (demo server redeploy)

Please read the docker/README for details of the Docker implementation. To get started quickly several examples will get you up and running.

Unit Testing

Unit tests are run using pytest from the top project folder:

pytest tests

NB beware that some tests require Provider dependencies (libraries) to be available and that the ElasticSearch and Postgres tests require their respective backend servers running.

Environment variables are set in the file pytest.ini.

Project details

Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pygeoapi, version 0.6.0
Filename, size File type Python version Upload date Hashes
Filename, size pygeoapi-0.6.0-py2.py3-none-any.whl (59.8 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size pygeoapi-0.6.0.tar.gz (34.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page