egml-io 0.0.2-alpha.1

IO operations for processing GML data.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::primitives::GmlSurfaceProperty;
use egml_core::model::geometry::primitives::SurfaceProperty;
use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
pub struct GmlShell {
    #[serde(rename(serialize = "gml:surfaceMember", deserialize = "surfaceMember"))]
    pub(crate) members: Vec<GmlSurfaceProperty>,
}

impl From<&[SurfaceProperty]> for GmlShell {
    fn from(members: &[SurfaceProperty]) -> Self {
        Self {
            members: members.iter().map(GmlSurfaceProperty::from).collect(),
        }
    }
}