pub enum Geom<P> {
Point(P),
MultiPoint(MultiPoint<P>),
Contour(Contour<P>),
MultiContour(MultiContour<P>),
Polygon(Polygon<P>),
MultiPolygon(MultiPolygon<P>),
}Expand description
Enum of different geometry types. This enum implements the Geometry trait so you can use any generic geometry
method without knowing a specific geometry type you are working with.
Variants§
Point(P)
Point geometry.
MultiPoint(MultiPoint<P>)
MultiPoint geometry.
Contour(Contour<P>)
Contour geometry.
MultiContour(MultiContour<P>)
MultiContour geometry.
Polygon(Polygon<P>)
Polygon geometry.
MultiPolygon(MultiPolygon<P>)
MultiPolygon geometry.
Trait Implementations§
Source§impl<P> CartesianGeometry2d<P> for Geom<P>where
P: CartesianPoint2d + GeometryType<Type = PointGeometryType, Space = CartesianSpace2d> + Copy,
impl<P> CartesianGeometry2d<P> for Geom<P>where
P: CartesianPoint2d + GeometryType<Type = PointGeometryType, Space = CartesianSpace2d> + Copy,
Source§fn is_point_inside<Other: CartesianPoint2d<Num = P::Num>>(
&self,
point: &Other,
tolerance: P::Num,
) -> bool
fn is_point_inside<Other: CartesianPoint2d<Num = P::Num>>( &self, point: &Other, tolerance: P::Num, ) -> bool
Checks if the given
point is inside the geometry with the given tolerance.Source§impl<'de, P> Deserialize<'de> for Geom<P>where
P: Deserialize<'de>,
impl<'de, P> Deserialize<'de> for Geom<P>where
P: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<P> From<MultiPolygon<P>> for Geom<P>
impl<P> From<MultiPolygon<P>> for Geom<P>
Source§fn from(value: MultiPolygon<P>) -> Self
fn from(value: MultiPolygon<P>) -> Self
Converts to this type from the input type.
Source§impl<P: GeometryType + Copy> Geometry for Geom<P>
impl<P: GeometryType + Copy> Geometry for Geom<P>
Source§fn project<Proj>(&self, projection: &Proj) -> Option<Geom<Proj::OutPoint>>
fn project<Proj>(&self, projection: &Proj) -> Option<Geom<Proj::OutPoint>>
Project the geometry using the given projection. Implementation of this method may choose to change type or
properties of a geometry. For example a strait line in a projected CRS can be projected as curved line along
the shortest path on the ellipsoid when projected into geographic coordinates. Read more
Source§impl<P: Ord> Ord for Geom<P>
impl<P: Ord> Ord for Geom<P>
Source§impl<P: PartialOrd> PartialOrd for Geom<P>
impl<P: PartialOrd> PartialOrd for Geom<P>
impl<P: Eq> Eq for Geom<P>
impl<P> StructuralPartialEq for Geom<P>
Auto Trait Implementations§
impl<P> Freeze for Geom<P>where
P: Freeze,
impl<P> RefUnwindSafe for Geom<P>where
P: RefUnwindSafe,
impl<P> Send for Geom<P>where
P: Send,
impl<P> Sync for Geom<P>where
P: Sync,
impl<P> Unpin for Geom<P>where
P: Unpin,
impl<P> UnwindSafe for Geom<P>where
P: UnwindSafe,
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<T> CoordinateMetadata for Twhere
T: ?Sized,
impl<T> CoordinateMetadata for Twhere
T: ?Sized,
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.