pub enum Geometry {
Point(Point),
LineString(LineString),
Polygon(Polygon),
MultiPoint(MultiPoint),
MultiLineString(MultiLineString),
MultiPolygon(MultiPolygon),
GeometryCollection(GeometryCollection),
}Expand description
Geometry type enumeration
Variants§
Point(Point)
Point geometry
LineString(LineString)
LineString geometry
Polygon(Polygon)
Polygon geometry
MultiPoint(MultiPoint)
MultiPoint geometry
MultiLineString(MultiLineString)
MultiLineString geometry
MultiPolygon(MultiPolygon)
MultiPolygon geometry
GeometryCollection(GeometryCollection)
GeometryCollection
Implementations§
Source§impl Geometry
impl Geometry
Sourcepub fn has_m(&self) -> bool
pub fn has_m(&self) -> bool
Returns true if any coordinate in this geometry has an M (measure) value.
Sourcepub fn z_values(&self) -> Option<Vec<f64>>
pub fn z_values(&self) -> Option<Vec<f64>>
Collects all Z values from the geometry’s coordinates in order.
Returns None if this geometry has no Z coordinates.
For coordinates without Z, substitutes 0.0.
Sourcepub fn m_values(&self) -> Option<Vec<f64>>
pub fn m_values(&self) -> Option<Vec<f64>>
Collects all M values from the geometry’s coordinates in order.
Returns None if this geometry has no M coordinates.
For coordinates without M, substitutes 0.0.
Sourcepub const fn geometry_type(&self) -> &'static str
pub const fn geometry_type(&self) -> &'static str
Returns the geometry type as a string
Source§impl Geometry
impl Geometry
Sourcepub fn to_wkb(&self) -> Vec<u8> ⓘ
pub fn to_wkb(&self) -> Vec<u8> ⓘ
Serializes this geometry to OGC WKB bytes (little-endian).
The returned Vec<u8> contains a complete, self-describing WKB blob that
can be consumed by any OGC-compliant geospatial library.
§Panics
This method cannot panic in practice: writing to a Vec<u8> is infallible.