pygeoapi

API for geospatial data


@tomkralidis @JMendesDeJesus @normanbarker @perrygeo @justb4 @pvgenuchten

version: June 19, 2019

I. In the beginning there was... WFS v1/v2

Characteristics

  • Key Value Parameters (KVP) or XML encodings
  • Requests using HTTP GET, HTTP POST and SOAP
  • Responses as XML (GML)
  • Error handling ExceptionReport in response

Issues with WFS v1/2

  • Highly verbose
  • Highly dependent on XML technologies
  • Verbose documentation (WFS 2.0 has 239 pages)
  • OGC document from 2010
  • No unique urls for features
  • Features hard to index by search engine
  • "In-band" error reporting

More Issues

  • ldproxy for services to be crawlable
  • OGC world is NOT W3C-/Web- friendly

II. A New Era is Upon Us

RESTFul

  • REST is becoming a MUST
  • Fast standards' development
  • Opinion:
    Standards (-development) should be more developer-friendly

What is REST ???

  • REpresentational State Transfer (REST)
  • Uses HTTP's verbs (GET/POST/DELETE)
  • Uses HTTP's codes (200, 404, 201, etc)
  • Uses URI to identify resources
  • Content negotiation (ask for media-type)
  • Stateless

  • Very popular among developers
  • Easy to understand
  • JSON is king in REST webservices
  • No rigid standards (good or bad)

III. Kickstarting WFS 3.0

WFS 3.0 Hackathon

  • March 2018 - Fort Collins, CO, USA
  • OGC-sponsored
  • Develop WFS 3.0 based on Swagger/OpenAPI (v3)
  • Write specification using GitHub
  • First implementations
  • pygeoapi was born on Valentine 2018!

IV. OpenAPI / Swagger

http://swagger.io

V. The WFS 3.0 Spec

NB: renamed as: "OGC API - Features"

Spec

github.com/opengeospatial/WFS_FES

Maintained in GitHub

By C. Portele - link
Check it in SwaggerHub

Example

	/collections

	/collections/countries

	/collections/countries/items

	/collections/countries/items/The_Netherlands
					
				

Data is structured and each Feature is a REST representation

OGC API - Features

Links

VI. pygeoapi

pygeoapi

geopython site

Part of the amazing Geopython community in GitHub

geopython.github.io

geopython.github.io

pygeoapi

  • A geospatial API framework - more than just a WFS v3 implementation
  • OGC Compliant (already!)
  • Access geospatial data via OGC APIs
  • OSGeo Community Project (in Motion)
  • Powered (default) by:
flask img

pygeoapi - technical

  • Flask with REST support
  • OpenAPI endpoint automatically generated
  • Data provider agnostic (plugins)
  • Docker Images

Data Providers

Elasticsearch CSV Spatialite* GeoJSON*

* also via GDAL-OGR Provider

Data Providers - Cont

GDAL-OGR

Data Providers - GDAL-OGR

  • via OGR-Python bindings
  • in theory ~100 Vector Formats!
  • thus: WFS2, GeoPackage, Shapefile, GeoJSON, PostGIS, ...
  • paging, reprojection, bbox/attr/id-query, auth
  • ==> unlock existing WFS2s!

https://pygeoapi.io

image pygeoapi site

Demo

pygeoapi-demo img

pygeoapi - Roadmap

  • More data providers
  • Content negotiation (e.g. Response as GeoPackage, GML,...)
  • Advanced filters (CQL)
  • More OGC APIs: Maps, Tiles, Coverages, Processes

pygeoapi - Links

VII. Docker and pygeoapi

Docker Images for geopython/pygeoapi

Docker - Next

  • Custom config via Docker Volume Mapping
  • Run with Docker Compose
  • Subpath running via Flask "SCRIPT_NAME" env var
  • Examples in pygeoapi GitHub

VIII. pygeoapi in Production

http://bit.do/hydat

Canadian National Water Data Archive

IX. STAC

https://github.com/radiantearth/stac-spec

X. pygeoapi Support


Need support for WFS3.0???

@Geocat can help you


justobjects.nl