stac
Rust implementation of the SpatioTemporal Asset Catalog (STAC) specification.
Usage
To use the library in your project:
[]
= "0.5"
Examples
use Item;
// Creates an item from scratch.
let item = new;
// Reads an item from the filesystem.
let item: Item = read.unwrap;
Please see the documentation for more usage examples.
Features
There are three opt-in features.
reqwest
reqwest
enables blocking remote reads:
[]
= { = "0.5", = ["reqwest"]}
Then:
let href = "https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/simple-item.json";
let item: Item = read.unwrap;
If reqwest
is not enabled, stac::read
will throw an error if you try to read from a url.
let href = "https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/simple-item.json";
let err = .unwrap_err;
For non-blocking IO, use the stac-async crate.
geo
To use geojson and geo to add some extra geo-enabled methods:
[]
= { = "0.5", = ["geo"] }
Then, you can set an item's geometry and bounding box at the same time:
schemars
schemars
allows for jsonschema generation from STAC objects.
This is mostly useful for auto-generating OpenAPI documentation for STAC APIs.
[]
= { = "0.5", = ["schemars"]}