1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
use crate::{Fields, Filter, Sortby};
use serde::{Deserialize, Serialize};
use serde_json::{Map, Value};
use stac::Geometry;
/// The core parameters for STAC search are defined by OAFeat, and STAC adds a few parameters for convenience.
#[derive(Clone, Default, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
pub struct Search {
/// The maximum number of results to return (page size).
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<u64>,
/// Requested bounding box.
#[serde(skip_serializing_if = "Option::is_none")]
pub bbox: Option<Vec<f64>>,
/// Single date+time, or a range ('/' separator), formatted to [RFC 3339,
/// section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6).
///
/// Use double dots `..` for open date ranges.
#[serde(skip_serializing_if = "Option::is_none")]
pub datetime: Option<String>,
/// Searches items by performing intersection between their geometry and provided GeoJSON geometry.
///
/// All GeoJSON geometry types must be supported.
#[serde(skip_serializing_if = "Option::is_none")]
pub intersects: Option<Geometry>,
/// Array of Item ids to return.
#[serde(skip_serializing_if = "Option::is_none")]
pub ids: Option<Vec<String>>,
/// Array of one or more Collection IDs that each matching Item must be in.
#[serde(skip_serializing_if = "Option::is_none")]
pub collections: Option<Vec<String>>,
/// Include/exclude fields from item collections.
#[serde(skip_serializing_if = "Option::is_none")]
pub fields: Option<Fields>,
/// Fields by which to sort results.
#[serde(skip_serializing_if = "Option::is_none")]
pub sortby: Option<Vec<Sortby>>,
/// Recommended to not be passed, but server must only accept
/// <http://www.opengis.net/def/crs/OGC/1.3/CRS84> as a valid value, may
/// reject any others
#[serde(skip_serializing_if = "Option::is_none", rename = "filter-crs")]
pub filter_crs: Option<String>,
/// CQL2 filter expression.
#[serde(flatten, skip_serializing_if = "Option::is_none")]
pub filter: Option<Filter>,
/// Additional filtering based on properties.
///
/// It is recommended to use the filter extension instead.
#[serde(skip_serializing_if = "Option::is_none")]
pub query: Option<Map<String, Value>>,
/// Additional fields.
#[serde(flatten)]
pub additional_fields: Map<String, Value>,
}