https://github.com/stac-utils/stac-rs
Tools and libraries for the SpatioTemporal Asset Catalog (STAC) specification, written in Rust
https://github.com/stac-utils/stac-rs
command-line earth-observation geospatial metadata python raster rust server stac
Last synced: about 1 month ago
JSON representation
Tools and libraries for the SpatioTemporal Asset Catalog (STAC) specification, written in Rust
- Host: GitHub
- URL: https://github.com/stac-utils/stac-rs
- Owner: stac-utils
- License: apache-2.0
- Created: 2021-03-29T17:08:13.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-04-10T13:20:38.000Z (about 1 month ago)
- Last Synced: 2025-04-12T06:07:22.754Z (about 1 month ago)
- Topics: command-line, earth-observation, geospatial, metadata, python, raster, rust, server, stac
- Language: Rust
- Homepage: https://stac-utils.github.io/stac-rs/
- Size: 5.83 MB
- Stars: 93
- Watchers: 3
- Forks: 14
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE-APACHE
- Code of conduct: CODE_OF_CONDUCT
- Codeowners: CODEOWNERS
Awesome Lists containing this project
- awesome-earthobservation-code - stac-rs - `Rust` implementation of the SpatioTemporal Asset Catalog (STAC) specification (`Python` processing of optical imagery (non deep learning) / Cloud Native Geospatial)
README
# stac-rs
[](https://github.com/stac-utils/stac-rs/actions/workflows/ci.yml)

[](./CODE_OF_CONDUCT)
Command Line Interface (CLI) and Rust libraries for the [SpatioTemporal Asset Catalog (STAC)](https://stacspec.org/) specification.
We have a Python package based on **stac-rs** that lives in its own repository, [stacrs](https://github.com/gadomski/stacrs).
For more on the difference between **stac-rs** and **stacrs**, see [our docs](https://stac-utils.github.io/stac-rs/).## Formats
**stac-rs** "speaks" three forms of STAC:
- **JSON**: STAC is derived from [GeoJSON](https://geojson.org/)
- **Newline-delimited JSON (ndjson)**: One JSON [item](https://github.com/radiantearth/stac-spec/blob/master/item-spec/item-spec.md) per line, often used for bulk item loading and storage
- **stac-geoparquet**: A newer [specification](https://github.com/stac-utils/stac-geoparquet) for storing STAC items, and optionally collectionsWe also have interfaces to other storage backends, e.g. Postgres via [pgstac](https://github.com/stac-utils/pgstac).
## Command line interface
Our command line interface (CLI) can query STAC APIs, validate STAC, and more.
Install:```shell
python -m pip install stacrs
# or
cargo install stac-cli
```Then:
```shell
# 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](./crates/core/README.md) | Core data structures and I/O | [](https://docs.rs/stac/latest/stac/)
[](https://crates.io/crates/stac) |
| [stac-api](./crates/api/README.md) | Data structures for the [STAC API](https://github.com/radiantearth/stac-api-spec) specification | [](https://docs.rs/stac-api/latest/stac_api/)
[](https://crates.io/crates/stac-api) |
| [stac-extensions](./crates/extensions/README.md) | Basic support for [STAC extensions](https://stac-extensions.github.io/) | [](https://docs.rs/stac-extensions/latest/stac_extensions/)
[](https://crates.io/crates/stac-extensions) |
| [stac-cli](./crates/cli/README.md) | Command line interface | [](https://docs.rs/stac-cli/latest/stac_cli/)
[](https://crates.io/crates/stac-cli) |
| [stac-server](./crates/server/README.md) | STAC API server with multiple backends | [](https://docs.rs/stac-server/latest/stac_server/)
[](https://crates.io/crates/stac-server) |
| [pgstac](./crates/pgstac/README.md) | Bindings for [pgstac](https://github.com/stac-utils/pgstac) | [](https://docs.rs/pgstac/latest/pgstac/)
[](https://crates.io/crates/pgstac) |
| [stac-duckdb](./crates/duckdb/README.md) | Experimental client for [duckdb](https://duckdb.org/) | [](https://docs.rs/stac-duckdb/latest/stac_duckdb/)
[](https://crates.io/crates/stac-duckdb) |### Dependency relationships
```mermaid
graph TD
stac --> stac-api
stac --> stac-extensions
stac --> stac-cli
stac --> pgstac
stac --> stac-duckdb
stac --> stac-server
stac-api --> pgstac
stac-api --> stac-duckdb
stac-api --> stac-server
stac-api --> stac-cli
pgstac --> stac-server
stac-duckdb --> stac-server
stac-server --> stac-cli
```> [!NOTE]
> There's one additional crate in [crates](./crates/), [stac-derive](./crates/derive/).
> This is not published and is for internal use only.## Development
See [CONTRIBUTING.md](./CONTRIBUTING.md) for information about contributing to this project.
See [RELEASING.md](./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](./LICENSE-APACHE) and [LICENSE-MIT](./LICENSE-MIT) for details.