Struct geo::MultiPolygon [−][src]
Expand description
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.
Tuple Fields
0: Vec<Polygon<T>, Global>
Implementations
Trait Implementations
impl<T> AbsDiffEq<MultiPolygon<T>> for MultiPolygon<T> where
T: AbsDiffEq<T, Epsilon = T> + CoordNum,
<T as AbsDiffEq<T>>::Epsilon: Copy,
impl<T> AbsDiffEq<MultiPolygon<T>> for MultiPolygon<T> where
T: AbsDiffEq<T, Epsilon = T> + CoordNum,
<T as AbsDiffEq<T>>::Epsilon: Copy,
pub fn abs_diff_eq(
&self,
other: &MultiPolygon<T>,
epsilon: <MultiPolygon<T> as AbsDiffEq<MultiPolygon<T>>>::Epsilon
) -> bool
pub fn abs_diff_eq(
&self,
other: &MultiPolygon<T>,
epsilon: <MultiPolygon<T> as AbsDiffEq<MultiPolygon<T>>>::Epsilon
) -> bool
Equality assertion with an absolute limit.
Examples
use geo_types::{polygon, Polygon, MultiPolygon};
let a_el: Polygon<f32> = polygon![(x: 0., y: 0.), (x: 5., y: 0.), (x: 7., y: 9.), (x: 0., y: 0.)];
let a = MultiPolygon(vec![a_el]);
let b_el: Polygon<f32> = polygon![(x: 0., y: 0.), (x: 5., y: 0.), (x: 7.01, y: 9.), (x: 0., y: 0.)];
let b = MultiPolygon(vec![b_el]);
approx::abs_diff_eq!(a, b, epsilon=0.1);
approx::abs_diff_ne!(a, b, epsilon=0.001);
type Epsilon = T
type Epsilon = T
Used for specifying relative comparisons.
The default tolerance to use when testing values that are close together. Read more
The inverse of AbsDiffEq::abs_diff_eq
.
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.
Find the closest point between self
and p
.
type Scalar = T
type Scalar = T
fn calculate_coordinate_position(
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
boundary_count: &mut usize
)
Return the number of coordinates in the MultiPolygon
.
type ExteriorIter = Flatten<MapExteriorCoordsIter<'a, T, Iter<'a, Polygon<T>>, Polygon<T>>>
type Scalar = T
Iterate over all exterior and (if any) interior coordinates of a geometry. Read more
Iterate over all exterior coordinates of a geometry. Read more
impl<T> EuclideanDistance<T, Line<T>> for MultiPolygon<T> where
T: GeoFloat + FloatConst + Signed + RTreeNum,
impl<T> EuclideanDistance<T, Line<T>> for MultiPolygon<T> where
T: GeoFloat + FloatConst + Signed + RTreeNum,
MultiPolygon to Line distance
Returns the distance between two geometries Read more
Minimum distance from a Point to a MultiPolygon
impl<T> EuclideanDistance<T, MultiPolygon<T>> for Line<T> where
T: GeoFloat + FloatConst + Signed + RTreeNum,
impl<T> EuclideanDistance<T, MultiPolygon<T>> for Line<T> where
T: GeoFloat + FloatConst + Signed + RTreeNum,
Line to MultiPolygon distance
Returns the distance between two geometries Read more
Minimum distance from a MultiPolygon to a Point
Performs the conversion.
Performs the conversion.
Performs the conversion.
Creates a value from an iterator. Read more
Some geometries, like a MultiPoint
, can have zero coordinates - we call these empty
. Read more
The dimensions of some geometries are fixed, e.g. a Point always has 0 dimensions. However
for others, the dimensionality depends on the specific geometry instance - for example
typical Rect
s are 2-dimensional, but it’s possible to create degenerate Rect
s which
have either 1 or 0 dimensions. Read more
The dimensions of the Geometry
’s boundary, as used by OGC-SFA. Read more
impl<T> Intersects<MultiPolygon<T>> for Point<T> where
MultiPolygon<T>: Intersects<Point<T>>,
T: CoordNum,
impl<T> Intersects<MultiPolygon<T>> for Point<T> where
MultiPolygon<T>: Intersects<Point<T>>,
T: CoordNum,
impl<T> Intersects<MultiPolygon<T>> for Line<T> where
MultiPolygon<T>: Intersects<Line<T>>,
T: CoordNum,
impl<T> Intersects<MultiPolygon<T>> for Line<T> where
MultiPolygon<T>: Intersects<Line<T>>,
T: CoordNum,
impl<T> Intersects<MultiPolygon<T>> for Rect<T> where
MultiPolygon<T>: Intersects<Rect<T>>,
T: CoordNum,
impl<T> Intersects<MultiPolygon<T>> for Rect<T> where
MultiPolygon<T>: Intersects<Rect<T>>,
T: CoordNum,
impl<T> Intersects<MultiPolygon<T>> for Polygon<T> where
MultiPolygon<T>: Intersects<Polygon<T>>,
T: CoordNum,
impl<T> Intersects<MultiPolygon<T>> for Polygon<T> where
MultiPolygon<T>: Intersects<Polygon<T>>,
T: CoordNum,
Orients a Polygon’s exterior and interior rings according to convention Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
impl<T> RelativeEq<MultiPolygon<T>> for MultiPolygon<T> where
T: AbsDiffEq<T, Epsilon = T> + CoordNum + RelativeEq<T>,
impl<T> RelativeEq<MultiPolygon<T>> for MultiPolygon<T> where
T: AbsDiffEq<T, Epsilon = T> + CoordNum + RelativeEq<T>,
pub fn relative_eq(
&self,
other: &MultiPolygon<T>,
epsilon: <MultiPolygon<T> as AbsDiffEq<MultiPolygon<T>>>::Epsilon,
max_relative: <MultiPolygon<T> as AbsDiffEq<MultiPolygon<T>>>::Epsilon
) -> bool
pub fn relative_eq(
&self,
other: &MultiPolygon<T>,
epsilon: <MultiPolygon<T> as AbsDiffEq<MultiPolygon<T>>>::Epsilon,
max_relative: <MultiPolygon<T> as AbsDiffEq<MultiPolygon<T>>>::Epsilon
) -> bool
Equality assertion within a relative limit.
Examples
use geo_types::{polygon, Polygon, MultiPolygon};
let a_el: Polygon<f32> = polygon![(x: 0., y: 0.), (x: 5., y: 0.), (x: 7., y: 9.), (x: 0., y: 0.)];
let a = MultiPolygon(vec![a_el]);
let b_el: Polygon<f32> = polygon![(x: 0., y: 0.), (x: 5., y: 0.), (x: 7.01, y: 9.), (x: 0., y: 0.)];
let b = MultiPolygon(vec![b_el]);
approx::assert_relative_eq!(a, b, max_relative=0.1);
approx::assert_relative_ne!(a, b, max_relative=0.001);
The default relative tolerance for testing values that are far-apart. Read more
The inverse of RelativeEq::relative_eq
.
Returns the simplified representation of a geometry, using the Ramer–Douglas–Peucker algorithm Read more
Returns the simplified representation of a geometry, using the Visvalingam-Whyatt algorithm Read more
Returns the simplified representation of a geometry, using a topology-preserving variant of the Visvalingam-Whyatt algorithm. Read more
Convert a Geometry enum into its inner type.
Fails if the enum case does not match the type you are trying to convert it to.
Auto Trait Implementations
impl<T> RefUnwindSafe for MultiPolygon<T> where
T: RefUnwindSafe,
impl<T> Send for MultiPolygon<T> where
T: Send,
impl<T> Sync for MultiPolygon<T> where
T: Sync,
impl<T> Unpin for MultiPolygon<T> where
T: Unpin,
impl<T> UnwindSafe for MultiPolygon<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Rotate a Geometry around an arbitrary point by an angle, given in degrees Read more