naurt_api/models/
polygon.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Polygon {
16 #[serde(rename = "coordinates")]
17 pub coordinates: Vec<Vec<Vec<f64>>>,
18 #[serde(rename = "type")]
19 pub r#type: Type,
20}
21
22impl Polygon {
23 pub fn new(coordinates: Vec<Vec<Vec<f64>>>, r#type: Type) -> Polygon {
24 Polygon {
25 coordinates,
26 r#type,
27 }
28 }
29}
30#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
32pub enum Type {
33 #[serde(rename = "Polygon")]
34 Polygon,
35}
36
37impl Default for Type {
38 fn default() -> Type {
39 Self::Polygon
40 }
41}
42