Git Product home page Git Product logo

eoapi's Introduction

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.

eoapi's People

Contributors

vincentsarago avatar drnextgis avatar sharkinsspatial avatar bitner avatar leothomas avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.