Struct geo_types::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>>
Implementations
Trait Implementations
impl<T> AbsDiffEq<MultiPolygon<T>> for MultiPolygon<T> where
T: AbsDiffEq<Epsilon = T> + CoordNum,
T::Epsilon: Copy,
impl<T> AbsDiffEq<MultiPolygon<T>> for MultiPolygon<T> where
T: AbsDiffEq<Epsilon = T> + CoordNum,
T::Epsilon: Copy,
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
.
Performs the conversion.
Creates a value from an iterator. 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<Epsilon = T> + CoordNum + RelativeEq,
impl<T> RelativeEq<MultiPolygon<T>> for MultiPolygon<T> where
T: AbsDiffEq<Epsilon = T> + CoordNum + RelativeEq,
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
.
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