Skip to content

Tools and libraries for the SpatioTemporal Asset Catalog (STAC) specification, written in Rust

License

Notifications You must be signed in to change notification settings

ceholden/stac-rs

 
 

Repository files navigation

stac-rs

GitHub Workflow Status Crates.io Contributor Covenant

Ferris the crab holding the STAC logo

Command Line Interface (CLI) and Rust libraries for the SpatioTemporal Asset Catalog (STAC) specification. We have a Python package based on stac-rs that lives in its own repository, stacrs. For more on the difference between stac-rs and stacrs, see our docs.

Formats

stac-rs "speaks" three forms of STAC:

  • JSON: STAC is derived from GeoJSON
  • Newline-delimited JSON (ndjson): One JSON item per line, often used for bulk item loading and storage
  • stac-geoparquet: A newer specification for storing STAC items, and optionally collections

We also have interfaces to other storage backends, e.g. Postgres via pgstac.

Command line interface

Our command line interface (CLI) can query STAC APIs, validate STAC, and more. Install:

pip install stacrs
# or
cargo install stac-cli

Then:

# Search
$ stacrs search https://landsatlook.usgs.gov/stac-server \
    --collections landsat-c2l2-sr \
    --intersects '{"type": "Point", "coordinates": [-105.119, 40.173]}' \
    --sortby='-properties.datetime' \
    --max-items 1000 \
    items.parquet

# Translate formats
$ stacrs translate items.parquet items.ndjson
$ stacrs translate items.ndjson items.json

# Migrate STAC versions
$ stacrs translate item-v1.0.json item-v1.1.json --migrate

# Search stac-geoparquet (no API server required)
$ stacrs search items.parquet

# Server
$ stacrs serve items.parquet  # Opens a STAC API server on http://localhost:7822

# Validate
$ stacrs validate item.json

Crates

This monorepo contains several crates:

Crate Description Badges
stac Core data structures and I/O docs.rs
Crates.io
stac-api Data structures for the STAC API specification docs.rs
Crates.io
stac-extensions Basic support for STAC extensions docs.rs
Crates.io
stac-cli Command line interface docs.rs
Crates.io
stac-server STAC API server with multiple backends docs.rs
Crates.io
pgstac Bindings for pgstac docs.rs
Crates.io
stac-duckdb Experimental client for duckdb docs.rs
Crates.io

Development

See CONTRIBUTING.md for information about contributing to this project. See RELEASING.md for a checklist to use when releasing a new version.

License

stac-rs is dual-licensed under both the MIT license and the Apache license (Version 2.0). See LICENSE-APACHE and LICENSE-MIT for details.

About

Tools and libraries for the SpatioTemporal Asset Catalog (STAC) specification, written in Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 98.0%
  • Shell 1.4%
  • Other 0.6%