developmentseed / eoapi-devseed

Custom eoAPI framework example for DevelopmentSeed
https://eoapi.dev/customization/
MIT License
5 stars 2 forks source link
eoapi

eoapi-devseed

Example of eoAPI customization.


Documentation: https://eoapi.dev/customization/

Source Code: https://github.com/developmentseed/eoapi-devseed


This repository shows an example of how users can customize and deploy their own version of eoAPI starting from eoapi-template.

Custom

Runtimes

eoapi.stac

Built on stac-fastapi.pgstac application, adding a TiTilerExtension and a simple Search Viewer.

When the EOAPI_STAC_TITILER_ENDPOINT environment variable is set (pointing to the raster application) and titiler extension is enabled, additional endpoints will be added to the stac-fastapi application (see: stac/extension.py):

eoapi.raster

The dynamic tiler deployed within eoapi-devseed is built on top of titiler-pgstac and pgstac. It enables large-scale mosaic based on the results of STAC search queries.

The service includes all the default endpoints from titiler-pgstac application and:

eoapi.vector

OGC Features and Tiles API built on top of tipg.

The API will look for tables in the database's public schema by default. We've also added three functions that connect to the pgSTAC schema:

Infrastructure

The CDK code is almost similar to the one found in eoapi-template. We just added some configurations for our custom runtimes.

Local testing

Before deploying the application on the cloud, you can start by exploring it with a local Docker deployment

docker compose up

Once the applications are up, you'll need to add STAC Collections and Items to the PgSTAC database. If you don't have, you can use the follow the MAXAR open data demo (or get inspired by the other demos).

Then you can start exploring your dataset with:

If you've added a vector dataset to the public schema in the Postgres database, they will be available through the Vector service at http://localhost:8083.

Deployment

Requirements

Installation

Install python dependencies with

python -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt

And node dependencies with

npm install

Verify that the cdk CLI is available. Since aws-cdk is installed as a local dependency, you can use the npx node package runner tool, that comes with npm.

npx cdk --version

First, synthesize the app

npx cdk synth --all

Then, deploy

npx cdk deploy --all --require-approval never