pub enum GeoGeometry {
Point(LonLat),
Point3D(LonLatElev),
LineString(Vec<LonLat>),
Polygon {
exterior: Vec<LonLat>,
holes: Vec<Vec<LonLat>>,
},
MultiPoint(Vec<LonLat>),
MultiLineString(Vec<Vec<LonLat>>),
MultiPolygon(Vec<(Vec<LonLat>, Vec<Vec<LonLat>>)>),
GeometryCollection(Vec<GeoGeometry>),
}Expand description
A GeoJSON geometry value.
Variants§
Point(LonLat)
A single position.
Point3D(LonLatElev)
A single position with elevation.
LineString(Vec<LonLat>)
An ordered sequence of positions forming an open curve.
Polygon
A polygon defined by an exterior ring and zero or more interior rings.
Fields
MultiPoint(Vec<LonLat>)
A collection of points.
MultiLineString(Vec<Vec<LonLat>>)
A collection of line strings.
MultiPolygon(Vec<(Vec<LonLat>, Vec<Vec<LonLat>>)>)
A collection of polygons.
GeometryCollection(Vec<GeoGeometry>)
A heterogeneous collection of geometries.
Implementations§
Source§impl GeoGeometry
impl GeoGeometry
Sourcepub fn bounding_box(&self) -> Option<BoundingBox>
pub fn bounding_box(&self) -> Option<BoundingBox>
Compute the axis-aligned bounding box of this geometry.
Returns None for empty collections.
Sourcepub fn collect_lonlat(&self) -> Vec<LonLat>
pub fn collect_lonlat(&self) -> Vec<LonLat>
Recursively collect all LonLat positions from this geometry.
Trait Implementations§
Source§impl Clone for GeoGeometry
impl Clone for GeoGeometry
Source§fn clone(&self) -> GeoGeometry
fn clone(&self) -> GeoGeometry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GeoGeometry
impl Debug for GeoGeometry
Source§impl PartialEq for GeoGeometry
impl PartialEq for GeoGeometry
Source§fn eq(&self, other: &GeoGeometry) -> bool
fn eq(&self, other: &GeoGeometry) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for GeoGeometry
Auto Trait Implementations§
impl Freeze for GeoGeometry
impl RefUnwindSafe for GeoGeometry
impl Send for GeoGeometry
impl Sync for GeoGeometry
impl Unpin for GeoGeometry
impl UnsafeUnpin for GeoGeometry
impl UnwindSafe for GeoGeometry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.