[][src]Struct geo::MultiPolygon

pub struct MultiPolygon<T>(pub Vec<Polygon<T>, Global>)
where
    T: CoordNum
;

A collection of Polygons. Can be created from a Vec of Polygons, or from an Iterator which yields Polygons. Iterating over this object yields the component Polygons.

Semantics

The interior and the boundary are the union of the interior and the boundary of the constituent polygons.

Validity

  • The interiors of no two constituent polygons may intersect.

  • The boundaries of two (distinct) constituent polygons may only intersect at finitely many points.

Refer to section 6.1.14 of the OGC-SFA for a formal definition of validity. Note that the validity is not enforced, but expected by the operations and predicates that operate on it.

Implementations

impl<T> MultiPolygon<T> where
    T: CoordNum
[src]

pub fn iter(&self) -> impl Iterator<Item = &Polygon<T>>[src]

pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut Polygon<T>>[src]

Trait Implementations

impl<T> Area<T> for MultiPolygon<T> where
    T: CoordFloat
[src]

Note. The implementation is a straight-forward summation of the signed areas of the individual polygons. In particular, unsigned_area is not necessarily the sum of the unsigned_area of the constituent polygons unless they are all oriented the same.

impl<T> BoundingRect<T> for MultiPolygon<T> where
    T: CoordNum
[src]

type Output = Option<Rect<T>>

pub fn bounding_rect(&self) -> Self::Output[src]

Return the BoundingRect for a MultiPolygon

impl<T> Centroid for MultiPolygon<T> where
    T: CoordFloat + FromPrimitive + Sum
[src]

type Output = Option<Point<T>>

impl<T> Clone for MultiPolygon<T> where
    T: Clone + CoordNum
[src]

impl<F: GeoFloat> ClosestPoint<F, Point<F>> for MultiPolygon<F>[src]

impl<T> ConcaveHull for MultiPolygon<T> where
    T: GeoFloat + RTreeNum
[src]

type Scalar = T

impl<G, T> Contains<G> for MultiPolygon<T> where
    T: CoordNum,
    Polygon<T>: Contains<G>, 
[src]

impl<T> ConvexHull for MultiPolygon<T> where
    T: GeoNum
[src]

type Scalar = T

impl<T> CoordinatePosition for MultiPolygon<T> where
    T: GeoNum
[src]

type Scalar = T

impl<'a, T: CoordNum + 'a> CoordsIter<'a> for MultiPolygon<T>[src]

type Iter = Flatten<MapCoordsIter<'a, T, Iter<'a, Polygon<T>>, Polygon<T>>>

type ExteriorIter = Flatten<MapExteriorCoordsIter<'a, T, Iter<'a, Polygon<T>>, Polygon<T>>>

type Scalar = T

pub fn coords_count(&'a self) -> usize[src]

Return the number of coordinates in the MultiPolygon.

impl<T> Debug for MultiPolygon<T> where
    T: Debug + CoordNum
[src]

impl<T> Eq for MultiPolygon<T> where
    T: Eq + CoordNum
[src]

impl<T> EuclideanDistance<T, Line<T>> for MultiPolygon<T> where
    T: GeoFloat + FloatConst + Signed + RTreeNum
[src]

MultiPolygon to Line distance

impl<T> EuclideanDistance<T, MultiPolygon<T>> for Point<T> where
    T: GeoFloat
[src]

pub fn euclidean_distance(&self, mpolygon: &MultiPolygon<T>) -> T[src]

Minimum distance from a Point to a MultiPolygon

impl<T> EuclideanDistance<T, MultiPolygon<T>> for Line<T> where
    T: GeoFloat + FloatConst + Signed + RTreeNum
[src]

Line to MultiPolygon distance

impl<T> EuclideanDistance<T, Point<T>> for MultiPolygon<T> where
    T: GeoFloat
[src]

pub fn euclidean_distance(&self, point: &Point<T>) -> T[src]

Minimum distance from a MultiPolygon to a Point

impl<T, IP> From<IP> for MultiPolygon<T> where
    T: CoordNum,
    IP: Into<Polygon<T>>, 
[src]

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

impl<T, IP> From<Vec<IP, Global>> for MultiPolygon<T> where
    T: CoordNum,
    IP: Into<Polygon<T>>, 
[src]

impl<T, IP> FromIterator<IP> for MultiPolygon<T> where
    T: CoordNum,
    IP: Into<Polygon<T>>, 
[src]

impl<C: CoordNum> HasDimensions for MultiPolygon<C>[src]

impl<T> Hash for MultiPolygon<T> where
    T: Hash + CoordNum
[src]

impl<G, T> Intersects<G> for MultiPolygon<T> where
    T: GeoNum,
    Polygon<T>: Intersects<G>, 
[src]

impl<T> Intersects<MultiPolygon<T>> for Point<T> where
    MultiPolygon<T>: Intersects<Point<T>>,
    T: CoordNum
[src]

impl<T> Intersects<MultiPolygon<T>> for Line<T> where
    MultiPolygon<T>: Intersects<Line<T>>,
    T: CoordNum
[src]

impl<T> Intersects<MultiPolygon<T>> for Rect<T> where
    MultiPolygon<T>: Intersects<Rect<T>>,
    T: CoordNum
[src]

impl<T> Intersects<MultiPolygon<T>> for Polygon<T> where
    MultiPolygon<T>: Intersects<Polygon<T>>,
    T: CoordNum
[src]

impl<'a, T> IntoIterator for &'a mut MultiPolygon<T> where
    T: CoordNum
[src]

type Item = &'a mut Polygon<T>

The type of the elements being iterated over.

type IntoIter = IterMut<'a, Polygon<T>>

Which kind of iterator are we turning this into?

impl<'a, T> IntoIterator for &'a MultiPolygon<T> where
    T: CoordNum
[src]

type Item = &'a Polygon<T>

The type of the elements being iterated over.

type IntoIter = Iter<'a, Polygon<T>>

Which kind of iterator are we turning this into?

impl<T> IntoIterator for MultiPolygon<T> where
    T: CoordNum
[src]

type Item = Polygon<T>

The type of the elements being iterated over.

type IntoIter = IntoIter<Polygon<T>, Global>

Which kind of iterator are we turning this into?

impl<T: CoordNum, NT: CoordNum> MapCoords<T, NT> for MultiPolygon<T>[src]

type Output = MultiPolygon<NT>

impl<T: CoordNum> MapCoordsInplace<T> for MultiPolygon<T>[src]

impl<T> Orient for MultiPolygon<T> where
    T: GeoNum
[src]

impl<T> PartialEq<MultiPolygon<T>> for MultiPolygon<T> where
    T: PartialEq<T> + CoordNum
[src]

impl<T> Rotate<T> for MultiPolygon<T> where
    T: CoordFloat + FromPrimitive + Sum
[src]

pub fn rotate(&self, angle: T) -> Self[src]

Rotate the contained Polygons about their centroids by the given number of degrees

impl<T> Simplify<T, T> for MultiPolygon<T> where
    T: GeoFloat
[src]

impl<T> SimplifyVW<T, T> for MultiPolygon<T> where
    T: CoordFloat
[src]

impl<T> SimplifyVWPreserve<T, T> for MultiPolygon<T> where
    T: CoordFloat + RTreeNum
[src]

impl<T> StructuralEq for MultiPolygon<T> where
    T: CoordNum
[src]

impl<T> StructuralPartialEq for MultiPolygon<T> where
    T: CoordNum
[src]

impl<T> TryFrom<Geometry<T>> for MultiPolygon<T> where
    T: CoordNum
[src]

type Error = FailedToConvertError

The type returned in the event of a conversion error.

impl<T: CoordNum, NT: CoordNum> TryMapCoords<T, NT> for MultiPolygon<T>[src]

type Output = MultiPolygon<NT>

Auto Trait Implementations

impl<T> RefUnwindSafe for MultiPolygon<T> where
    T: RefUnwindSafe
[src]

impl<T> Send for MultiPolygon<T> where
    T: Send
[src]

impl<T> Sync for MultiPolygon<T> where
    T: Sync
[src]

impl<T> Unpin for MultiPolygon<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for MultiPolygon<T> where
    T: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T, G> Extremes<'a, T> for G where
    T: CoordNum,
    G: CoordsIter<'a, Scalar = T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, G> RotatePoint<T> for G where
    T: CoordFloat,
    G: MapCoords<T, T, Output = G>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, G> Translate<T> for G where
    T: CoordNum,
    G: MapCoords<T, T, Output = G> + MapCoordsInplace<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.