Skip to content

sat-utils/sat-api

Repository files navigation

sat-api

CircleCI

Sat-api is a STAC compliant web API for searching and serving metadata for geospatial data (including but not limited to satellite imagery).

Development Seed runs an instance of sat-api for the Landsat-8 and Sentinel-2 imagery that is hosted on AWS. You can access this at https://sat-api.developmentseed.org using the API documentation for reference and examples.

The STAC version supported by a given version of sat-api is shown in the table below. Additional information can be found in the CHANGELOG

sat-api STAC
0.1.0 0.5.x
0.2.x 0.6.x
0.3.x 0.7.x

Usage

This repository contains just the Node libraries for running the API. The sat-api-deployment repository is for deploying sat-api to AWS.

Environment variables

There are some environment variables used in the code. Some do not have defaults and must be set.

Name Description Default Value
STAC_ID ID of this catalog -
STAC_TITLE Title of this catalog -
STAC_DESCRIPTION Description of this catalog -
STAC_DOCS_URL URL to documentation -
SATAPI_URL The root endpoint of this API to use for links Inferred from request
ES_BATCH_SIZE Number of records to ingest in single batch 500
SATAPI_ES_PRECISION Precision to use for geometry queries, see ES documentation '5mi'
LOG_LEVEL Level for logging 'info'

Development

Sat-api includes a number of NPM packages (in the packages/ directory) that are used to create and populate an instance of sat-api. See the sat-utils org on NPM for the full list of packages. Lerna is used for for managing these packages.

The latest version released is on the master branch, and the latest development version is on the develop branch.

Building local version

# Install dependencies in package.json
$ yarn

# Run lerna boostrap to link together packages and install those package dependencies
$ yarn bootstrap

# Run the build command in each of the packages (runs webpack)
$ yarn build

# To continually watch and build source files
$ yarn watch

# To run tests for all packages
$ yarn test

Building API docs

# To build API docs from the api spec
$ yarn build-api-docs

Creating a release

To create a new version for npm:

  • create a new branch from master
  • $ yarn update
  • Follow the prompt and select the correct the version, then commit the changes.
  • Update CHANGELOG.md.
  • Tag your branch with the same version number
  • Make a PR
  • When the PR is merged to master, the npm packages are automatically deployed to npm
  • In GitHub create a release with the version (prefixed with 'v') and paste in the CHANGELOG section. This will create a GitHub release and a tag.

About

sat-api was created by Development Seed and is part of a collection of tools called sat-utils.