use std::collections::HashMap;
pub mod geojson;
pub mod mvt;
pub mod ops;
#[derive(Debug)]
pub struct FeatureLayer {
pub name: String,
pub extent: u32,
pub features: Vec<Feature>,
}
#[derive(Debug)]
pub struct Feature {
pub id: Option<u64>,
pub geometry: Geometry,
pub properties: HashMap<String, Value>,
}
#[derive(Debug, Default, Clone)]
pub struct Geometry {
pub points: Vec<(i32, i32)>,
pub lines: Vec<Vec<(i32, i32)>>,
pub polygons: Vec<Polygon>,
}
impl Geometry {
pub fn is_empty(&self) -> bool {
self.points.is_empty() && self.lines.is_empty() && self.polygons.is_empty()
}
pub fn extend(&mut self, other: Geometry) {
self.points.extend(other.points);
self.lines.extend(other.lines);
self.polygons.extend(other.polygons);
}
}
#[derive(Debug, Clone)]
pub struct Polygon {
pub exterior: Vec<(i32, i32)>,
pub holes: Vec<Vec<(i32, i32)>>,
}
#[derive(Debug, Clone)]
pub enum Value {
String(String),
Float(f32),
Double(f64),
Int(i64),
UInt(u64),
SInt(i64),
Bool(bool),
Null,
}