geospatial-jeff / cognition-datasources

Standardized query interface for searching geospatial assets via STAC.
Apache License 2.0
17 stars 3 forks source link

About

This library defines a pluggable, STAC-compliant, service for searching geospatial assets, primarily remotely sensed imagery, and serves two primary purposes:

  1. Define a pluggable driver interface (similar to GraphQL resolvers) for wrapping the STAC spec around legacy datasources.
  2. Provide a framework for loading / executing drivers both locally and in the cloud.

Each driver translates the STAC-compliant request into a format compatible with the underlying API while translating the API response to a valid STAC Item. Drivers are packaged and deployed to AWS Lambda and a single API Gateway endpoint is created which allows searching the loaded datasources. The goal is to create an extensible service which allows users to integrate their datasets with the STAC ecosystem without having to change how their data is stored and queried.

title

Installation

git clone https://github.com/geospatial-jeff/cognition-datasources
cd cognition-datasources
python setup.py develop

Deployment

# Load datasources
cognition-datasources -d Landsat8 -d Sentinel2 -d SRTM -d NAIP

# Build docker container
docker build . -t cognition-datasources:latest

# Package service
docker run --rm -v $PWD:/home/cognition-datasources -it cognition-datasources:latest package-service.sh

# Deploy to AWS
sls deploy -v

Read the deployment docs for more information on deployment.

Usage

The deployment generates an AWS API Gateway endpoint which supports STAC-compliant searches of the loaded datasources through the /stac/search endpoint (POST). Read the API docs for usage details.

A live example lives here.

Testing

Each driver must pass a standard set of test cases and uses CircleCI to ensure only working drivers are loaded into the library. View the status of each driver here.

Contributing

Check out the contributing docs for step-by-step guide for building your own driver.

Supported Datasource Drivers

Name Source STAC-Compliant Notes
DGOpenData Digital Globe Open Data Program False Builds index with a web scraper.
ElevationTiles AWS Earth: Terrain Tiles False Sends header requests to AWS S3 Bucket.
CBERS AWS Earth: CBERS False Sends requests to earth-search
Landsat8 AWS Earth: Landsat8 True Sends requests to earth-search.
NAIP AWS Earth: NAIP False Sends requests to AWS S3 Bucket (RequesterPays).
PlanetData Planet Data API False Sends request to the Planet Python Client
Sentinel1 Copernicus Open Access Hub False Sends requests to CopernicusAPIHub with help of sentinelsat.
Sentinel2 AWS Earth: Sentinel2 True Sends requests to earth-search.
SRTM AWS: Terrain Tiles False Does not send any requests.
USGS 3DEP AWS: USGS 3DEP False Sends request to AWS S3 Bucket.
Microsoft Building Footprints Microsoft / ESRI False Sends requests to ESRI Feature Layer