Skip to content

geospatial-jeff/cognition-datasources

Repository files navigation

cognition-datasources

CircleCI

About

This library defines a STAC-compliant standardized interface for searching geospatial assets, primarily remotely sensed imagery. The Spatio-Temporal-Asset-Catalog (STAC) specification provides common metadata and API schemas to search and access geospatial data. The standardized interface used by the library is based on the STAC spec and allows searching across three dimensions:

  • Spatial: Find all assets which intersect a bounding box.
  • Temporal: Find all assets acquired within a temporal window.
  • Properties: Find all assets with certain metadata.

Not all commonly used datasources are currently STAC-compliant. In such cases, the library maintains a standardized search interface by wrapping the API with a STAC-compatible API which parses the initial search parameters into a format compatable with the underlying API. A request to the API is sent and the response is parsed into a STAC Item and returned to the user. The table below of supported datasources states which are STAC-compliant.

title

Usage

Python

from datasources import Manifest
from datasources.sources import Landsat8, Sentinel2

# Create manifest
manifest = Manifest()

# Load sources
manifest.load_sources(Landsat8, Sentinel2)

# Search arguments
spatial = {"type": "Polygon", "coordinates": [[...]]}
temporal = ("2018-10-30", "2018-12-31")

# Create searches
for source in manifest:
    manifest[source].search(spatial, temporal=temporal)

# Execute searches
response = manifest.execute()

CLI

cognition-datasources search xmin ymin xmax ymax --start-date "2018-10-30" --end-date "2018-12-31" -d Landsat8 -d SRTM --output response.json

Testing

Unittests for each datasource are found in tests. The library provides a CLI for creating and validating example STAC Items for each datasource.

cognition-datasources examples --build --validate

Documentation

Read the quickstart and documentation.

Supported Datasources

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 AWS S3 Bucket (RequesterPays) with help of aws-sat-api.
Landsat8 AWS Earth: Landsat8 True Sends requests to sat-api.
NAIP AWS Earth: NAIP False Sends requests to AWS S3 Bucket (RequesterPays).
Sentinel1 Copernicus Open Access Hub False Sends requests to CopernicusAPIHub with help of sentinelsat.
Sentinel2 AWS Earth: Sentinel2 True Sends requests to sat-api.
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

About

Standardized query interface for searching geospatial assets via STAC.

Resources

License

Stars

Watchers

Forks

Packages

No packages published