Skip to main content

met_office_api/models/
feature.rs

1/*
2 * Global three hourly spot data
3 *
4 * This API provides three hourly weather forecast data for a requested coordinate defined by a latitude and longitude. The format of the data is GeoJSON.
5 *
6 * The version of the OpenAPI document: 1.0.1
7 * Contact: enquiries@metoffice.gov.uk
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// Feature : A feature object with mandatory geometry and properties fields
12
13
14
15#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
16pub struct Feature {
17    /// The GeoJSON type identifier
18    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
19    pub r#type: Option<String>,
20    #[serde(rename = "geometry")]
21    pub geometry: Box<crate::models::Point>,
22    #[serde(rename = "properties")]
23    pub properties: Box<crate::models::Properties>,
24}
25
26impl Feature {
27    /// A feature object with mandatory geometry and properties fields
28    pub fn new(geometry: crate::models::Point, properties: crate::models::Properties) -> Feature {
29        Feature {
30            r#type: None,
31            geometry: Box::new(geometry),
32            properties: Box::new(properties),
33        }
34    }
35}
36
37