Skip to content

[Work in Progress] Earth Observation API (STAC + dynamic Raster/Vector Tiler)

License

Notifications You must be signed in to change notification settings

anayeaye/eoAPI

 
 

Repository files navigation

Earth Observation API

Deploy a STAC API and a dynamic mosaic tiler API using AWS CDK.

Test Downloads


Source Code: https://github.com/developmentseed/eoAPI


The Earth Observation API

EOapi is a combination of multiple elements:

The project's goal is to enable a full, but easy to deploy, Earth Observation API for Metadata search (STAC), Raster and Vector services.

A custom version of stac-fastapi, adding a TiTilerExtension and a simple Search Viewer.

Features

  • Full stac-fastapi implementation

  • Simple STAC Search viewer

  • Proxy to the Tiler endpoint for STAC Items

    When TITILER_ENDPOINT environement is set (pointing the raster application), additional endpoints will be added to the stac-fastapi application (see: stac/extension.py):

    • /collections/{collectionId}/items/{itemId}/tilejson.json: Return the raster tilejson for an item
    • /collections/{collectionId}/items/{itemId}/viewer: Redirect to the raster viewer

STAC Search viewer

The dynamic tiler deployed within eoAPI is built on top of titiler-pgstac and pgstac. It enables large scale mosaic based on results of STAC searches queries:

  • Full titiler-pgstac implementation
  • base64 encoded STAC item support for STAC Proxy

TiTiler-PgSTAC workflow

Features (Optional) -> /src/eoapi/features

Simple and Fast Geospatial Feature Server for PgSTAC

This can be seen as a simplistic version of stac-fastapi

Vector (Experimental) -> /src/eoapi/vector

Mapbox Vector Tile server for STAC queries.

Local

You can launch the APIs locally using docker. This will start 3 services: database, eoapi.stac, eoapi.raster

$ git clone https://github.com/developmentseed/eoAPI.git
$ cd eoAPI
$ docker-compose build
$ docker-compose up stac raster

Project structure

 ├──demo/                  - items/collections and notebook
 ├──deployment/            - AWS CDK code
 └──src/eoapi/
    ├── raster/            - eoAPI raster Application package
    ├── stac/              - eoAPI stac Application package
    ├── features/          - eoAPI feature Application package [OPTIONAL]
    └── vector/            - eoAPI vector Application package [EXPERIMENTAL]

Deployment

The stack is deployed by the AWS CDK utility. Under the hood, CDK will create the deployment packages required for AWS Lambda, upload it to AWS, and handle the creation of the Lambda and API Gateway resources.

  1. Install CDK and connect to your AWS account. This step is only necessary once per AWS account.

    # Download titiler repo
    $ git clone https://github.com/developmentseed/eoapi.git
    
    # install cdk dependencies
    $ pip install -r deployment/requirements.txt
    $ npm install
    
    $ npm run cdk bootstrap # Deploys the CDK toolkit stack into an AWS environment
    
    # in specific region
    $ npm run cdk bootstrap aws://${AWS_ACCOUNT_ID}/eu-central-1
  2. Pre-Generate CFN template

    $ npm run cdk synth  # Synthesizes and prints the CloudFormation template for this stack
  3. Update settings

    Set environment variable or hard code in deployment/.env file (e.g CDK_EOAPI_DB_PGSTAC_VERSION=0.4.3).

    Important:

    • EOAPI_DB_PGSTAC_VERSION is a required env
    • You can choose which functions to deploy by setting CDK_EOAPI_FUNCTIONS env (e.g CDK_EOAPI_FUNCTIONS='["stac","raster","features"]')
  4. Deploy

    $ EOAPI_STAGE=staging CDK_EOAPI_DB_PGSTAC_VERSION=0.4.3 npm run cdk deploy eoapi-staging --profile {my-aws-profile}
    
    # Deploy in specific region
    $ AWS_DEFAULT_REGION=eu-central-1 AWS_REGION=eu-central-1 CDK_EOAPI_DB_PGSTAC_VERSION=0.4.3 npm run cdk deploy eoapi-production --profile {my-aws-profile}

Contribution & Development

See CONTRIBUTING.md

License

See LICENSE

Authors

Created by Development Seed

See contributors for a listing of individual contributors.

Changes

See CHANGES.md.

About

[Work in Progress] Earth Observation API (STAC + dynamic Raster/Vector Tiler)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 67.6%
  • HTML 29.5%
  • Shell 2.9%