geoengine_api_client/models/histogram.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/// Histogram : The `Histogram` is a _plot operator_ that computes a histogram plot either over attributes of a vector dataset or values of a raster source. The output is a plot in [Vega-Lite](https://vega.github.io/vega-lite/) specification. For instance, you want to plot the data distribution of numeric attributes of a feature collection. Then you can use a histogram with a suitable number of buckets to visualize and assess this. ## Errors The operator returns an error if the selected column (`columnName`) does not exist or is not numeric. ## Notes If `bounds` or `buckets` are not defined, the operator will determine these values by itself which requires processing the data twice. If the `buckets` parameter is set to `squareRootChoiceRule`, the operator estimates it using the square root of the number of elements in the data.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Histogram {
17 #[serde(rename = "params")]
18 pub params: Box<models::HistogramParameters>,
19 #[serde(rename = "sources")]
20 pub sources: Box<models::SingleRasterOrVectorSource>,
21 #[serde(rename = "type")]
22 pub r#type: Type,
23}
24
25impl Histogram {
26 /// The `Histogram` is a _plot operator_ that computes a histogram plot either over attributes of a vector dataset or values of a raster source. The output is a plot in [Vega-Lite](https://vega.github.io/vega-lite/) specification. For instance, you want to plot the data distribution of numeric attributes of a feature collection. Then you can use a histogram with a suitable number of buckets to visualize and assess this. ## Errors The operator returns an error if the selected column (`columnName`) does not exist or is not numeric. ## Notes If `bounds` or `buckets` are not defined, the operator will determine these values by itself which requires processing the data twice. If the `buckets` parameter is set to `squareRootChoiceRule`, the operator estimates it using the square root of the number of elements in the data.
27 pub fn new(params: models::HistogramParameters, sources: models::SingleRasterOrVectorSource, r#type: Type) -> Histogram {
28 Histogram {
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 = "Histogram")]
39 Histogram,
40}
41
42impl Default for Type {
43 fn default() -> Type {
44 Self::Histogram
45 }
46}
47