[−][src]Enum geo::Geometry
An enum representing any possible geometry type.
All Geo
types can be converted to a Geometry
member using .into()
(as part of the
std::convert::Into
pattern).
Variants
Point(Point<T>)
Line(Line<T>)
LineString(LineString<T>)
Polygon(Polygon<T>)
MultiPoint(MultiPoint<T>)
MultiLineString(MultiLineString<T>)
MultiPolygon(MultiPolygon<T>)
GeometryCollection(GeometryCollection<T>)
Methods
impl<T> Geometry<T> where
T: CoordinateType,
[src]
T: CoordinateType,
pub fn into_point(self) -> Option<Point<T>>
[src]
If this Geometry is a Point, then return that, else None.
Examples
use geo_types::*; let g = Geometry::Point(Point::new(0., 0.)); let p2: Point<f32> = g.into_point().unwrap(); assert_eq!(p2, Point::new(0., 0.,));
pub fn into_line_string(self) -> Option<LineString<T>>
[src]
If this Geometry is a LineString, then return that LineString, else None.
pub fn into_line(self) -> Option<Line<T>>
[src]
If this Geometry is a Line, then return that Line, else None.
pub fn into_polygon(self) -> Option<Polygon<T>>
[src]
If this Geometry is a Polygon, then return that, else None.
pub fn into_multi_point(self) -> Option<MultiPoint<T>>
[src]
If this Geometry is a MultiPoint, then return that, else None.
pub fn into_multi_line_string(self) -> Option<MultiLineString<T>>
[src]
If this Geometry is a MultiLineString, then return that, else None.
pub fn into_multi_polygon(self) -> Option<MultiPolygon<T>>
[src]
If this Geometry is a MultiPolygon, then return that, else None.
Trait Implementations
impl<T> Clone for Geometry<T> where
T: Clone + CoordinateType,
[src]
T: Clone + CoordinateType,
fn clone(&self) -> Geometry<T>
[src]
default fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T> From<Polygon<T>> for Geometry<T> where
T: CoordinateType,
[src]
T: CoordinateType,
impl<T> From<MultiPoint<T>> for Geometry<T> where
T: CoordinateType,
[src]
T: CoordinateType,
fn from(x: MultiPoint<T>) -> Geometry<T>
[src]
impl<T> From<Point<T>> for Geometry<T> where
T: CoordinateType,
[src]
T: CoordinateType,
impl<T> From<Line<T>> for Geometry<T> where
T: CoordinateType,
[src]
T: CoordinateType,
impl<T> From<MultiPolygon<T>> for Geometry<T> where
T: CoordinateType,
[src]
T: CoordinateType,
fn from(x: MultiPolygon<T>) -> Geometry<T>
[src]
impl<T> From<MultiLineString<T>> for Geometry<T> where
T: CoordinateType,
[src]
T: CoordinateType,
fn from(x: MultiLineString<T>) -> Geometry<T>
[src]
impl<T> From<LineString<T>> for Geometry<T> where
T: CoordinateType,
[src]
T: CoordinateType,
fn from(x: LineString<T>) -> Geometry<T>
[src]
impl<T> Debug for Geometry<T> where
T: Debug + CoordinateType,
[src]
T: Debug + CoordinateType,
impl<T> PartialEq<Geometry<T>> for Geometry<T> where
T: PartialEq<T> + CoordinateType,
[src]
T: PartialEq<T> + CoordinateType,
impl<T: CoordinateType, NT: CoordinateType> MapCoords<T, NT> for Geometry<T>
[src]
type Output = Geometry<NT>
fn map_coords(&self, func: &dyn Fn(&(T, T)) -> (NT, NT)) -> Self::Output
[src]
impl<T: CoordinateType, NT: CoordinateType> TryMapCoords<T, NT> for Geometry<T>
[src]
type Output = Geometry<NT>
fn try_map_coords(
&self,
func: &dyn Fn(&(T, T)) -> Result<(NT, NT), Error>
) -> Result<Self::Output, Error>
[src]
&self,
func: &dyn Fn(&(T, T)) -> Result<(NT, NT), Error>
) -> Result<Self::Output, Error>
impl<T: CoordinateType> MapCoordsInplace<T> for Geometry<T>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, G> RotatePoint for G where
G: MapCoords<T, T, Output = G>,
T: Float,
[src]
G: MapCoords<T, T, Output = G>,
T: Float,
fn rotate_around_point(&Self, T, Point<T>) -> G
[src]
impl<T, G> Translate for G where
G: MapCoords<T, T, Output = G> + MapCoordsInplace<T>,
T: CoordinateType,
[src]
G: MapCoords<T, T, Output = G> + MapCoordsInplace<T>,
T: CoordinateType,
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,