Expand description
STAC (SpatioTemporal Asset Catalog) support for OxiGDAL.
This crate provides Pure Rust implementation of the STAC specification, enabling cloud-native geospatial workflows with catalogs, collections, and items.
§Features
- STAC 1.0.0 Specification: Full compliance with STAC 1.0.0
- Core Models: Catalog, Collection, Item, and Asset
- Extensions: EO (Electro-Optical) and Projection extensions
- STAC API Client: Async HTTP client for searching STAC APIs
- Builder Patterns: Fluent APIs for easy object creation
- Validation: Comprehensive validation of STAC objects
- Pure Rust: No C/Fortran dependencies
§Example
use oxigdal_stac::{ItemBuilder, Asset};
use chrono::Utc;
// Create a STAC Item
let item = ItemBuilder::new("my-item")
.datetime(Utc::now())
.bbox(-122.5, 37.5, -122.0, 38.0)
.simple_asset("visual", "https://example.com/image.tif")
.build()?;
// Serialize to JSON
let json = serde_json::to_string_pretty(&item)?;
println!("{}", json);§STAC API Search
use oxigdal_stac::StacClient;
// Create a STAC API client
let client = StacClient::new("https://earth-search.aws.element84.com/v1")?;
// Search for items
let results = client.search()
.collections(vec!["sentinel-2-l2a"])
.bbox([-122.5, 37.5, -122.0, 38.0])
.limit(10)
.execute()
.await?;
println!("Found {} items", results.features.len());Re-exports§
pub use aggregation::Aggregation;pub use aggregation::AggregationRequest;pub use aggregation::AggregationResponse;pub use aggregation::AggregationResult;pub use aggregation::Bucket;pub use api::CollectionSummary;pub use api::CollectionsList;pub use api::ConformanceDeclaration;pub use api::FieldsSpec;pub use api::ItemCollection;pub use api::LandingPage;pub use api::SearchContext as ApiSearchContext;pub use api::SearchRequest as ApiSearchRequest;pub use api::SortDirection as ApiSortDirection;pub use api::SortField;pub use asset::Asset;pub use asset::media_types;pub use asset::roles;pub use builder::CatalogBuilder;pub use builder::CollectionBuilder;pub use builder::ItemBuilder;pub use catalog::Catalog;pub use collection::Collection;pub use collection::Extent;pub use collection::Provider;pub use collection::SpatialExtent;pub use collection::TemporalExtent;pub use collection_aggregation::CollectionAggregator;pub use collection_aggregation::CollectionStats;pub use collection_aggregation::NumericStats;pub use cql2::Cql2Filter;pub use cql2::Cql2Operand;pub use error::Result;pub use error::StacError;pub use extensions::eo::Band;pub use extensions::eo::CommonBandName;pub use extensions::eo::EoExtension;pub use extensions::projection::ProjectionExtension;pub use extensions::projection::epsg_codes;pub use extensions::sar::FrequencyBand;pub use extensions::sar::ObservationDirection;pub use extensions::sar::Polarization;pub use extensions::sar::SarExtension;pub use extensions::scientific::Publication;pub use extensions::scientific::ScientificExtension;pub use extensions::timestamps::TimestampsExtension;pub use extensions::version::VersionExtension;pub use extensions::view::ViewExtension;pub use item::Item;pub use item::ItemProperties;pub use item::Link;pub use item::link_rel;pub use transaction::StacItemStore;pub use transaction::TransactionOp;pub use transaction::TransactionResult;pub use pagination::CursorPagination;pub use pagination::PagePagination;pub use pagination::Paginator;pub use pagination::TokenPagination;pub use search::SearchContext;pub use search::SearchParams;pub use search::SearchResults;pub use search::SortBy;pub use search::SortDirection;pub use search::StacClient;pub use chrono;pub use geojson;pub use serde_json;
Modules§
- aggregation
- Aggregation support for STAC API.
- api
- STAC API resource types.
- asset
- STAC Asset representation.
- builder
- Builder patterns for STAC objects.
- catalog
- STAC Catalog representation.
- client
- Transport-agnostic STAC API client module.
- collection
- STAC Collection representation.
- collection_
aggregation - Collection-level aggregation statistics for STAC collections.
- cql2
- CQL2 (Common Query Language 2) Filter support.
- error
- Error types for STAC operations.
- extensions
- STAC Extensions.
- item
- STAC Item representation.
- pagination
- Pagination support for STAC API searches.
- search
- STAC API search client.
- transaction
- STAC Transaction Extension — create / update / upsert / delete items and collections in a STAC API catalog.
Constants§
- STAC_
VERSION - STAC version supported by this crate.
Functions§
- bbox
- Helper function to create a bounding box from coordinates.
- bbox_
to_ polygon - Helper function to create a GeoJSON Polygon geometry from a bounding box.
- point_
geometry - Helper function to create a GeoJSON Point geometry.