stac-rs

GitHub Workflow Status docs.rs Crates.io Crates.io Contributor Covenant

Rust implementation of the SpatioTemporal Asset Catalog (STAC) specification.

Usage

To use the library in your project:

toml [dependencies] stac = "0.4"

Features

There are three opt-in features: jsonschema, reqwest, and set_query.

jsonschema

The jsonschema feature enables validation against json-schema definitions:

toml [dependencies] stac = { version = "0.4", features = ["jsonschema"]}

The jsonschema feature also enables the reqwest feature.

reqwest

If you'd like to use the library with reqwest for blocking remote reads:

toml [dependencies] stac = { version = "0.4", features = ["reqwest"]}

If reqwest is not enabled, stac::read will throw an error if you try to read from a url.

set_query

The set_query feature adds a single method to Link. It is behind a feature because it adds a dependency, serde_urlencoded. To enable:

toml stac = { version = "0.4", features = ["set_query"]}

Examples

```rust // Create an item from scratch. let item = stac::Item::new("an-id");

// Read an item from the filesystem. let item: stac::Item = stac::read("data/simple-item.json").unwrap(); ```

Please see the documentation for more usage examples.