[−][src]Struct geo::MultiPolygon
A collection of Polygon
s. Can
be created from a Vec
of Polygon
s, or from an
Iterator which yields Polygon
s. Iterating over this
object yields the component Polygon
s.
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]
T: CoordNum,
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]
T: CoordFloat,
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.
pub fn signed_area(&self) -> T
[src]
pub fn unsigned_area(&self) -> T
[src]
impl<T> BoundingRect<T> for MultiPolygon<T> where
T: CoordNum,
[src]
T: CoordNum,
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]
T: CoordFloat + FromPrimitive + Sum,
impl<T> Clone for MultiPolygon<T> where
T: Clone + CoordNum,
[src]
T: Clone + CoordNum,
pub fn clone(&self) -> MultiPolygon<T>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<F: GeoFloat> ClosestPoint<F, Point<F>> for MultiPolygon<F>
[src]
pub fn closest_point(&self, p: &Point<F>) -> Closest<F>
[src]
impl<T> ConcaveHull for MultiPolygon<T> where
T: GeoFloat + RTreeNum,
[src]
T: GeoFloat + RTreeNum,
impl<G, T> Contains<G> for MultiPolygon<T> where
T: CoordNum,
Polygon<T>: Contains<G>,
[src]
T: CoordNum,
Polygon<T>: Contains<G>,
impl<T> ConvexHull for MultiPolygon<T> where
T: GeoNum,
[src]
T: GeoNum,
type Scalar = T
pub fn convex_hull(&self) -> Polygon<T>
[src]
impl<T> CoordinatePosition for MultiPolygon<T> where
T: GeoNum,
[src]
T: GeoNum,
type Scalar = T
pub fn calculate_coordinate_position(
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
boundary_count: &mut usize
)
[src]
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
boundary_count: &mut usize
)
pub fn coordinate_position(&self, coord: &Coordinate<Self::Scalar>) -> CoordPos
[src]
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_iter(&'a self) -> Self::Iter
[src]
pub fn coords_count(&'a self) -> usize
[src]
Return the number of coordinates in the MultiPolygon
.
pub fn exterior_coords_iter(&'a self) -> Self::ExteriorIter
[src]
impl<T> Debug for MultiPolygon<T> where
T: Debug + CoordNum,
[src]
T: Debug + CoordNum,
impl<T> Eq for MultiPolygon<T> where
T: Eq + CoordNum,
[src]
T: Eq + CoordNum,
impl<T> EuclideanDistance<T, Line<T>> for MultiPolygon<T> where
T: GeoFloat + FloatConst + Signed + RTreeNum,
[src]
T: GeoFloat + FloatConst + Signed + RTreeNum,
MultiPolygon to Line distance
pub fn euclidean_distance(&self, other: &Line<T>) -> T
[src]
impl<T> EuclideanDistance<T, MultiPolygon<T>> for Point<T> where
T: GeoFloat,
[src]
T: GeoFloat,
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]
T: GeoFloat + FloatConst + Signed + RTreeNum,
Line to MultiPolygon distance
pub fn euclidean_distance(&self, mpolygon: &MultiPolygon<T>) -> T
[src]
impl<T> EuclideanDistance<T, Point<T>> for MultiPolygon<T> where
T: GeoFloat,
[src]
T: GeoFloat,
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]
T: CoordNum,
IP: Into<Polygon<T>>,
pub fn from(x: IP) -> MultiPolygon<T>
[src]
impl<T> From<MultiPolygon<T>> for Geometry<T> where
T: CoordNum,
[src]
T: CoordNum,
pub fn from(x: MultiPolygon<T>) -> Geometry<T>
[src]
impl<T, IP> From<Vec<IP, Global>> for MultiPolygon<T> where
T: CoordNum,
IP: Into<Polygon<T>>,
[src]
T: CoordNum,
IP: Into<Polygon<T>>,
pub fn from(x: Vec<IP, Global>) -> MultiPolygon<T>
[src]
impl<T, IP> FromIterator<IP> for MultiPolygon<T> where
T: CoordNum,
IP: Into<Polygon<T>>,
[src]
T: CoordNum,
IP: Into<Polygon<T>>,
pub fn from_iter<I>(iter: I) -> MultiPolygon<T> where
I: IntoIterator<Item = IP>,
[src]
I: IntoIterator<Item = IP>,
impl<C: CoordNum> HasDimensions for MultiPolygon<C>
[src]
pub fn is_empty(&self) -> bool
[src]
pub fn dimensions(&self) -> Dimensions
[src]
pub fn boundary_dimensions(&self) -> Dimensions
[src]
impl<T> Hash for MultiPolygon<T> where
T: Hash + CoordNum,
[src]
T: Hash + CoordNum,
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<G, T> Intersects<G> for MultiPolygon<T> where
T: GeoNum,
Polygon<T>: Intersects<G>,
[src]
T: GeoNum,
Polygon<T>: Intersects<G>,
pub fn intersects(&self, rhs: &G) -> bool
[src]
impl<T> Intersects<MultiPolygon<T>> for Point<T> where
MultiPolygon<T>: Intersects<Point<T>>,
T: CoordNum,
[src]
MultiPolygon<T>: Intersects<Point<T>>,
T: CoordNum,
pub fn intersects(&self, rhs: &MultiPolygon<T>) -> bool
[src]
impl<T> Intersects<MultiPolygon<T>> for Line<T> where
MultiPolygon<T>: Intersects<Line<T>>,
T: CoordNum,
[src]
MultiPolygon<T>: Intersects<Line<T>>,
T: CoordNum,
pub fn intersects(&self, rhs: &MultiPolygon<T>) -> bool
[src]
impl<T> Intersects<MultiPolygon<T>> for Rect<T> where
MultiPolygon<T>: Intersects<Rect<T>>,
T: CoordNum,
[src]
MultiPolygon<T>: Intersects<Rect<T>>,
T: CoordNum,
pub fn intersects(&self, rhs: &MultiPolygon<T>) -> bool
[src]
impl<T> Intersects<MultiPolygon<T>> for Polygon<T> where
MultiPolygon<T>: Intersects<Polygon<T>>,
T: CoordNum,
[src]
MultiPolygon<T>: Intersects<Polygon<T>>,
T: CoordNum,
pub fn intersects(&self, rhs: &MultiPolygon<T>) -> bool
[src]
impl<'a, T> IntoIterator for &'a mut MultiPolygon<T> where
T: CoordNum,
[src]
T: CoordNum,
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?
pub fn into_iter(self) -> <&'a mut MultiPolygon<T> as IntoIterator>::IntoIter
[src]
impl<'a, T> IntoIterator for &'a MultiPolygon<T> where
T: CoordNum,
[src]
T: CoordNum,
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?
pub fn into_iter(self) -> <&'a MultiPolygon<T> as IntoIterator>::IntoIter
[src]
impl<T> IntoIterator for MultiPolygon<T> where
T: CoordNum,
[src]
T: CoordNum,
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?
pub fn into_iter(self) -> <MultiPolygon<T> as IntoIterator>::IntoIter
[src]
impl<T: CoordNum, NT: CoordNum> MapCoords<T, NT> for MultiPolygon<T>
[src]
type Output = MultiPolygon<NT>
pub fn map_coords(
&self,
func: impl Fn(&(T, T)) -> (NT, NT) + Copy
) -> Self::Output
[src]
&self,
func: impl Fn(&(T, T)) -> (NT, NT) + Copy
) -> Self::Output
impl<T: CoordNum> MapCoordsInplace<T> for MultiPolygon<T>
[src]
impl<T> Orient for MultiPolygon<T> where
T: GeoNum,
[src]
T: GeoNum,
pub fn orient(&self, direction: Direction) -> MultiPolygon<T>
[src]
impl<T> PartialEq<MultiPolygon<T>> for MultiPolygon<T> where
T: PartialEq<T> + CoordNum,
[src]
T: PartialEq<T> + CoordNum,
pub fn eq(&self, other: &MultiPolygon<T>) -> bool
[src]
pub fn ne(&self, other: &MultiPolygon<T>) -> bool
[src]
impl<T> Rotate<T> for MultiPolygon<T> where
T: CoordFloat + FromPrimitive + Sum,
[src]
T: CoordFloat + FromPrimitive + Sum,
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]
T: GeoFloat,
impl<T> SimplifyVW<T, T> for MultiPolygon<T> where
T: CoordFloat,
[src]
T: CoordFloat,
pub fn simplifyvw(&self, epsilon: &T) -> MultiPolygon<T>
[src]
impl<T> SimplifyVWPreserve<T, T> for MultiPolygon<T> where
T: CoordFloat + RTreeNum,
[src]
T: CoordFloat + RTreeNum,
pub fn simplifyvw_preserve(&self, epsilon: &T) -> MultiPolygon<T>
[src]
impl<T> StructuralEq for MultiPolygon<T> where
T: CoordNum,
[src]
T: CoordNum,
impl<T> StructuralPartialEq for MultiPolygon<T> where
T: CoordNum,
[src]
T: CoordNum,
impl<T> TryFrom<Geometry<T>> for MultiPolygon<T> where
T: CoordNum,
[src]
T: CoordNum,
type Error = FailedToConvertError
The type returned in the event of a conversion error.
pub fn try_from(
geom: Geometry<T>
) -> Result<MultiPolygon<T>, <MultiPolygon<T> as TryFrom<Geometry<T>>>::Error>
[src]
geom: Geometry<T>
) -> Result<MultiPolygon<T>, <MultiPolygon<T> as TryFrom<Geometry<T>>>::Error>
impl<T: CoordNum, NT: CoordNum> TryMapCoords<T, NT> for MultiPolygon<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for MultiPolygon<T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<T> Send for MultiPolygon<T> where
T: Send,
[src]
T: Send,
impl<T> Sync for MultiPolygon<T> where
T: Sync,
[src]
T: Sync,
impl<T> Unpin for MultiPolygon<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> UnwindSafe for MultiPolygon<T> where
T: UnwindSafe,
[src]
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<'a, T, G> Extremes<'a, T> for G where
T: CoordNum,
G: CoordsIter<'a, Scalar = T>,
[src]
T: CoordNum,
G: CoordsIter<'a, Scalar = T>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, G> RotatePoint<T> for G where
T: CoordFloat,
G: MapCoords<T, T, Output = G>,
[src]
T: CoordFloat,
G: MapCoords<T, T, Output = G>,
pub fn rotate_around_point(&Self, T, Point<T>) -> G
[src]
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, G> Translate<T> for G where
T: CoordNum,
G: MapCoords<T, T, Output = G> + MapCoordsInplace<T>,
[src]
T: CoordNum,
G: MapCoords<T, T, Output = G> + MapCoordsInplace<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,