Skip to main content

geoengine_api_client/models/
statistics.rs

1/*
2 * Geo Engine API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 0.9.0
7 * Contact: dev@geoengine.de
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Statistics : The `Statistics` operator is a _plot operator_ that computes count statistics over  - a selection of numerical columns of a single vector dataset, or - multiple raster datasets.  The output is a JSON description.  For instance, you want to get an overview of a raster data source. Then, you can use this operator to get basic count statistics.  ## Vector Data  In the case of vector data, the operator generates one statistic for each of the selected numerical attributes. The operator returns an error if one of the selected attributes is not numeric.  ## Raster Data  For raster data, the operator generates one statistic for each input raster.  ## Inputs  The operator consumes exactly one _vector_ or multiple _raster_ operators.  | Parameter | Type                                 | | --------- | ------------------------------------ | | `source`  | `MultipleRasterOrSingleVectorSource` |  ## Errors  The operator returns an error in the following cases.  - Vector data: The `attribute` for one of the given `columnNames` is not numeric. - Vector data: The `attribute` for one of the given `columnNames` does not exist. - Raster data: The length of the `columnNames` parameter does not match the number of input rasters.  ### Example Output  ```json {   \"A\": {     \"valueCount\": 6,     \"validCount\": 6,     \"min\": 1.0,     \"max\": 6.0,     \"mean\": 3.5,     \"stddev\": 1.707,     \"percentiles\": [       {         \"percentile\": 0.25,         \"value\": 2.0       },       {         \"percentile\": 0.5,         \"value\": 3.5       },       {         \"percentile\": 0.75,         \"value\": 5.0       }     ]   } } ``` 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Statistics {
17    #[serde(rename = "params")]
18    pub params: Box<models::StatisticsParameters>,
19    #[serde(rename = "sources")]
20    pub sources: Box<models::MultipleRasterOrSingleVectorSource>,
21    #[serde(rename = "type")]
22    pub r#type: Type,
23}
24
25impl Statistics {
26    /// The `Statistics` operator is a _plot operator_ that computes count statistics over  - a selection of numerical columns of a single vector dataset, or - multiple raster datasets.  The output is a JSON description.  For instance, you want to get an overview of a raster data source. Then, you can use this operator to get basic count statistics.  ## Vector Data  In the case of vector data, the operator generates one statistic for each of the selected numerical attributes. The operator returns an error if one of the selected attributes is not numeric.  ## Raster Data  For raster data, the operator generates one statistic for each input raster.  ## Inputs  The operator consumes exactly one _vector_ or multiple _raster_ operators.  | Parameter | Type                                 | | --------- | ------------------------------------ | | `source`  | `MultipleRasterOrSingleVectorSource` |  ## Errors  The operator returns an error in the following cases.  - Vector data: The `attribute` for one of the given `columnNames` is not numeric. - Vector data: The `attribute` for one of the given `columnNames` does not exist. - Raster data: The length of the `columnNames` parameter does not match the number of input rasters.  ### Example Output  ```json {   \"A\": {     \"valueCount\": 6,     \"validCount\": 6,     \"min\": 1.0,     \"max\": 6.0,     \"mean\": 3.5,     \"stddev\": 1.707,     \"percentiles\": [       {         \"percentile\": 0.25,         \"value\": 2.0       },       {         \"percentile\": 0.5,         \"value\": 3.5       },       {         \"percentile\": 0.75,         \"value\": 5.0       }     ]   } } ``` 
27    pub fn new(params: models::StatisticsParameters, sources: models::MultipleRasterOrSingleVectorSource, r#type: Type) -> Statistics {
28        Statistics {
29            params: Box::new(params),
30            sources: Box::new(sources),
31            r#type,
32        }
33    }
34}
35/// 
36#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
37pub enum Type {
38    #[serde(rename = "Statistics")]
39    Statistics,
40}
41
42impl Default for Type {
43    fn default() -> Type {
44        Self::Statistics
45    }
46}
47