Crate stac_api

Source
Expand description

Rust implementation of the STAC API specification.

This crate is:

  • Data structures

This crate is not:

  • A server implementation

For a STAC API server written in Rust based on this crate, see our stac-server.

§Data structures

Each API endpoint has its own data structure. In some cases, these are light wrappers around stac data structures. In other cases, they can be different – e.g. the /search endpoint may not return Items if the fields extension is used, so the return type is a crate-specific Item struct.

For example, here’s the root structure (a.k.a the landing page):

use stac::Catalog;
use stac_api::{Root, Conformance, CORE_URI};
let root = Root {
    catalog: Catalog::new("an-id", "a description"),
    conformance: Conformance {
        conforms_to: vec![CORE_URI.to_string()]
    },
};

Re-exports§

pub use client::BlockingClient;client
pub use client::Client;client

Modules§

clientclient
A STAC API client.
pythonpython
Functions for convert pyo3 objects into stac-api structures.

Structs§

Collections
Object containing an array of collections and an array of links.
Conformance
To support “generic” clients that want to access multiple OGC API Features implementations - and not “just” a specific API / server, the server has to declare the conformance classes it implements and conforms to.
Context
The search-related metadata for the ItemCollection.
Fields
Include/exclude fields from item collections.
GetItems
GET parameters for the items endpoint from STAC API - Features.
GetSearch
GET parameters for the item search endpoint.
ItemCollection
The return value of the /items and /search endpoints.
Items
Parameters for the items endpoint from STAC API - Features.
Root
The root landing page of a STAC API.
Search
The core parameters for STAC search are defined by OAFeat, and STAC adds a few parameters for convenience.
Sortby
Fields by which to sort results.
UrlBuilder
Builds urls on a root url.

Enums§

Direction
The direction of sorting.
Error
Crate-specific error enum.
Filter
The language of the filter expression.

Constants§

COLLECTIONS_URI
The collections conformance uri.
CORE_URI
The core conformance uri.
FEATURES_URI
The features conformance uri.
FILTER_URIS
The filter conformance uris.
GEOJSON_URI
The GeoJSON spec conformance uri.
ITEM_SEARCH_URI
The item search conformance uri.
OGC_API_FEATURES_URI
The OGC API - Features - Part 1 Requirements Class Core uri

Functions§

version
Return this crate’s version.

Type Aliases§

Item
A STAC API Item type definition.
Result
Crate-specific result type.