Enum geo::Geometry [] [src]

pub enum Geometry<T> where
    T: CoordinateType
{ Point(Point<T>), Line(Line<T>), LineString(LineString<T>), Polygon(Polygon<T>), MultiPoint(MultiPoint<T>), MultiLineString(MultiLineString<T>), MultiPolygon(MultiPolygon<T>), GeometryCollection(GeometryCollection<T>), }

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

Methods

impl<T> Geometry<T> where
    T: CoordinateType
[src]

[src]

If this Geometry is a Point, then return that, else None.

use geo_types::*;
let g = Geometry::Point(Point::new(0., 0.));
let p2: Point<f32> = g.as_point().unwrap();
assert_eq!(p2, Point::new(0., 0.,));

[src]

If this Geometry is a LineString, then return that LineString, else None.

[src]

If this Geometry is a Line, then return that Line, else None.

[src]

If this Geometry is a Polygon, then return that, else None.

[src]

If this Geometry is a MultiPoint, then return that, else None.

[src]

If this Geometry is a MultiLineString, then return that, else None.

[src]

If this Geometry is a MultiPolygon, then return that, else None.

Trait Implementations

impl<T> PartialEq<Geometry<T>> for Geometry<T> where
    T: PartialEq<T> + CoordinateType
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl<T> From<MultiPolygon<T>> for Geometry<T> where
    T: CoordinateType
[src]

[src]

Performs the conversion.

impl<T> From<MultiPoint<T>> for Geometry<T> where
    T: CoordinateType
[src]

[src]

Performs the conversion.

impl<T> From<MultiLineString<T>> for Geometry<T> where
    T: CoordinateType
[src]

[src]

Performs the conversion.

impl<T> From<Polygon<T>> for Geometry<T> where
    T: CoordinateType
[src]

[src]

Performs the conversion.

impl<T> From<Point<T>> for Geometry<T> where
    T: CoordinateType
[src]

[src]

Performs the conversion.

impl<T> From<LineString<T>> for Geometry<T> where
    T: CoordinateType
[src]

[src]

Performs the conversion.

impl<T> Clone for Geometry<T> where
    T: Clone + CoordinateType
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T> Debug for Geometry<T> where
    T: Debug + CoordinateType
[src]

[src]

Formats the value using the given formatter. Read more

impl<T: CoordinateType, NT: CoordinateType> MapCoords<T, NT> for Geometry<T>
[src]

[src]

Apply a function to all the coordinates in a geometric object, returning a new object. Read more

impl<T: CoordinateType, NT: CoordinateType> TryMapCoords<T, NT> for Geometry<T>
[src]

[src]

Map a fallible function over all the coordinates in a geometry, returning a Result Read more

impl<T: CoordinateType> MapCoordsInplace<T> for Geometry<T>
[src]

[src]

Apply a function to all the coordinates in a geometric object, in place Read more

Auto Trait Implementations

impl<T> Send for Geometry<T> where
    T: Send

impl<T> Sync for Geometry<T> where
    T: Sync