geoengine-api-client 0.9.1

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * Geo Engine API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * Contact: dev@geoengine.de
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// SpatialPartition2D : A partition of space that include the upper left but excludes the lower right coordinate
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SpatialPartition2D {
    #[serde(rename = "lowerRightCoordinate")]
    pub lower_right_coordinate: Box<models::Coordinate2D>,
    #[serde(rename = "upperLeftCoordinate")]
    pub upper_left_coordinate: Box<models::Coordinate2D>,
}

impl SpatialPartition2D {
    /// A partition of space that include the upper left but excludes the lower right coordinate
    pub fn new(lower_right_coordinate: models::Coordinate2D, upper_left_coordinate: models::Coordinate2D) -> SpatialPartition2D {
        SpatialPartition2D {
            lower_right_coordinate: Box::new(lower_right_coordinate),
            upper_left_coordinate: Box::new(upper_left_coordinate),
        }
    }
}

impl std::fmt::Display for SpatialPartition2D {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(
            f,
            "{xmin},{ymin},{xmax},{ymax}",
            xmin = self.upper_left_coordinate.x,
            ymin = self.lower_right_coordinate.y,
            xmax = self.lower_right_coordinate.x,
            ymax = self.upper_left_coordinate.y
        )
    }
}