pub enum Geometry {
Point(Point),
LineString(LineString),
Polygon(Polygon),
MultiPoint(MultiPoint),
MultiLineString(MultiLineString),
MultiPolygon(MultiPolygon),
GeometryCollection(Vec<Geometry>),
}Expand description
Any supported geometry type (OGC Simple Features).
Matches the seven GeoJSON geometry types one-to-one.
Variants§
Point(Point)
A single point.
LineString(LineString)
An ordered sequence of coordinates.
Polygon(Polygon)
A polygon with optional holes.
MultiPoint(MultiPoint)
Multiple points.
MultiLineString(MultiLineString)
Multiple line strings.
MultiPolygon(MultiPolygon)
Multiple polygons.
GeometryCollection(Vec<Geometry>)
A heterogeneous collection of geometries.
Implementations§
Source§impl Geometry
impl Geometry
Sourcepub fn type_name(&self) -> &'static str
pub fn type_name(&self) -> &'static str
Return the name of the geometry type (e.g. "Point", "Polygon").
Useful for diagnostics and GeoJSON round-tripping.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Return true if the geometry contains no coordinate data.
A GeometryCollection is empty when it contains zero children
or all children are themselves empty.
Sourcepub fn coord_count(&self) -> usize
pub fn coord_count(&self) -> usize
Count the total number of coordinate vertices in this geometry.
For compound types the count is the sum of all children.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Geometry
impl RefUnwindSafe for Geometry
impl Send for Geometry
impl Sync for Geometry
impl Unpin for Geometry
impl UnsafeUnpin for Geometry
impl UnwindSafe for Geometry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more