ogcapi_client/lib.rs
1//! Client support for OGC APIs
2//!
3//! # Example
4//!
5//! ```rust, ignore
6//! use ogcapi_client::Client;
7//! use ogcapi_types::common::Bbox;
8//! use ogcapi_types::stac::SearchParams;
9//!
10//! # fn main() {
11//! // Setup a client for a given STAC endpoint
12//! let endpoint = "https://data.geo.admin.ch/api/stac/v0.9/";
13//! let client = Client::new(endpoint).unwrap();
14//!
15//! // Fetch root catalog and print `id`
16//! let root = client.root().unwrap();
17//! println!("Root catalog id: {}", root.id);
18//!
19//! // Count catalogs
20//! let catalogs = client.catalogs().unwrap();
21//! println!("Found {} catalogs!", catalogs.count());
22//!
23//! // Search items
24//! let bbox = Bbox::from([7.4473, 46.9479, 7.4475, 46.9481]);
25//! let params = SearchParams::new()
26//! .with_bbox(bbox)
27//! .with_collections(["ch.swisstopo.swissalti3d"].as_slice());
28//! let items = client.search(params).unwrap();
29//! println!("Found {} items!", items.count());
30//! # }
31
32mod client;
33mod error;
34
35#[cfg(feature = "processes")]
36mod processes;
37
38pub use client::Client;
39pub use error::Error;