Crate stac_async
source ·Expand description
Asynchronous I/O for STAC, built on stac-rs
Examples
Read a single STAC item:
let item: stac::Item = stac_async::read("data/simple-item.json").await.unwrap();
Build an API client to read from a STAC API:
use futures_util::StreamExt;
let url = "https://planetary-computer.microsoft.com/api/stac/v1";
let api_client = stac_async::ApiClient::new(url).unwrap();
// Get the first sentinel2 item using an asynchronous stream
let items = api_client.items("sentinel2-l2a", None).await.unwrap();
tokio::pin!(items);
let item = items.next().await.unwrap().unwrap();
Download assets from an item:
use stac_async::Download;
let item: stac::Item = stac_async::read("data/simple-item.json").await.unwrap();
item.download("target-directory").await.unwrap();
Re-exports
pub use download::download;
pub use download::Download;
pub use download::Downloader;
Modules
- Download assets.
Structs
- A client for interacting with STAC APIs.
- A thin wrapper around reqwest::Client.
Enums
- Crate-specific error type.
Functions
- Reads a STAC value from an href.
- Reads any deserializable value from an href.
- Writes any serializable value to a path.
Type Aliases
- Crate-specific result type.