Struct geo::geometry::MultiPolygon
source · [−]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
sourceimpl<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,
sourcefn abs_diff_eq(
&self,
other: &MultiPolygon<T>,
epsilon: <MultiPolygon<T> as AbsDiffEq<MultiPolygon<T>>>::Epsilon
) -> bool
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::new(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::new(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.
sourcefn default_epsilon() -> <MultiPolygon<T> as AbsDiffEq<MultiPolygon<T>>>::Epsilon
fn default_epsilon() -> <MultiPolygon<T> as AbsDiffEq<MultiPolygon<T>>>::Epsilon
The default tolerance to use when testing values that are close together. Read more
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
The inverse of [AbsDiffEq::abs_diff_eq
].
sourceimpl<T> Area<T> for MultiPolygon<T> where
T: CoordFloat,
impl<T> Area<T> for MultiPolygon<T> where
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.
fn signed_area(&self) -> T
fn unsigned_area(&self) -> T
sourceimpl<T: GeoFloat> BooleanOps for MultiPolygon<T>
impl<T: GeoFloat> BooleanOps for MultiPolygon<T>
type Scalar = T
fn boolean_op(&self, other: &Self, op: OpType) -> MultiPolygon<Self::Scalar>
fn intersection(&self, other: &Self) -> MultiPolygon<Self::Scalar>
fn union(&self, other: &Self) -> MultiPolygon<Self::Scalar>
fn xor(&self, other: &Self) -> MultiPolygon<Self::Scalar>
fn difference(&self, other: &Self) -> MultiPolygon<Self::Scalar>
sourceimpl<T> BoundingRect<T> for MultiPolygon<T> where
T: CoordNum,
impl<T> BoundingRect<T> for MultiPolygon<T> where
T: CoordNum,
sourceimpl<T> Centroid for MultiPolygon<T> where
T: GeoFloat,
impl<T> Centroid for MultiPolygon<T> where
T: GeoFloat,
sourceimpl<T> ChaikinSmoothing<T> for MultiPolygon<T> where
T: CoordFloat + FromPrimitive,
impl<T> ChaikinSmoothing<T> for MultiPolygon<T> where
T: CoordFloat + FromPrimitive,
sourcefn chaikin_smoothing(&self, n_iterations: usize) -> Self
fn chaikin_smoothing(&self, n_iterations: usize) -> Self
create a new geometry with the Chaikin smoothing being
applied n_iterations
times. Read more
sourceimpl<T> ChamberlainDuquetteArea<T> for MultiPolygon<T> where
T: CoordFloat,
impl<T> ChamberlainDuquetteArea<T> for MultiPolygon<T> where
T: CoordFloat,
fn chamberlain_duquette_signed_area(&self) -> T
fn chamberlain_duquette_unsigned_area(&self) -> T
sourceimpl<T> Clone for MultiPolygon<T> where
T: Clone + CoordNum,
impl<T> Clone for MultiPolygon<T> where
T: Clone + CoordNum,
sourcefn clone(&self) -> MultiPolygon<T>
fn clone(&self) -> MultiPolygon<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<F: GeoFloat> ClosestPoint<F, Point<F>> for MultiPolygon<F>
impl<F: GeoFloat> ClosestPoint<F, Point<F>> for MultiPolygon<F>
sourcefn closest_point(&self, p: &Point<F>) -> Closest<F>
fn closest_point(&self, p: &Point<F>) -> Closest<F>
Find the closest point between self
and p
.
sourceimpl<T> ConcaveHull for MultiPolygon<T> where
T: GeoFloat + RTreeNum,
impl<T> ConcaveHull for MultiPolygon<T> where
T: GeoFloat + RTreeNum,
sourceimpl<T> Contains<Coordinate<T>> for MultiPolygon<T> where
T: GeoNum,
impl<T> Contains<Coordinate<T>> for MultiPolygon<T> where
T: GeoNum,
fn contains(&self, coord: &Coordinate<T>) -> bool
sourceimpl<F> Contains<GeometryCollection<F>> for MultiPolygon<F> where
F: GeoFloat,
impl<F> Contains<GeometryCollection<F>> for MultiPolygon<F> where
F: GeoFloat,
fn contains(&self, rhs: &GeometryCollection<F>) -> bool
sourceimpl<F> Contains<Line<F>> for MultiPolygon<F> where
F: GeoFloat,
impl<F> Contains<Line<F>> for MultiPolygon<F> where
F: GeoFloat,
sourceimpl<F> Contains<LineString<F>> for MultiPolygon<F> where
F: GeoFloat,
impl<F> Contains<LineString<F>> for MultiPolygon<F> where
F: GeoFloat,
fn contains(&self, rhs: &LineString<F>) -> bool
sourceimpl<F> Contains<MultiLineString<F>> for MultiPolygon<F> where
F: GeoFloat,
impl<F> Contains<MultiLineString<F>> for MultiPolygon<F> where
F: GeoFloat,
fn contains(&self, rhs: &MultiLineString<F>) -> bool
sourceimpl<T: GeoNum> Contains<MultiPoint<T>> for MultiPolygon<T>
impl<T: GeoNum> Contains<MultiPoint<T>> for MultiPolygon<T>
fn contains(&self, rhs: &MultiPoint<T>) -> bool
sourceimpl<F> Contains<MultiPolygon<F>> for MultiPolygon<F> where
F: GeoFloat,
impl<F> Contains<MultiPolygon<F>> for MultiPolygon<F> where
F: GeoFloat,
fn contains(&self, rhs: &MultiPolygon<F>) -> bool
sourceimpl<T> Contains<Point<T>> for MultiPolygon<T> where
T: GeoNum,
impl<T> Contains<Point<T>> for MultiPolygon<T> where
T: GeoNum,
sourceimpl<F> Contains<Polygon<F>> for MultiPolygon<F> where
F: GeoFloat,
impl<F> Contains<Polygon<F>> for MultiPolygon<F> where
F: GeoFloat,
sourceimpl<F> Contains<Rect<F>> for MultiPolygon<F> where
F: GeoFloat,
impl<F> Contains<Rect<F>> for MultiPolygon<F> where
F: GeoFloat,
sourceimpl<F> Contains<Triangle<F>> for MultiPolygon<F> where
F: GeoFloat,
impl<F> Contains<Triangle<F>> for MultiPolygon<F> where
F: GeoFloat,
sourceimpl<T> ConvexHull for MultiPolygon<T> where
T: GeoNum,
impl<T> ConvexHull for MultiPolygon<T> where
T: GeoNum,
type Scalar = T
fn convex_hull(&self) -> Polygon<T>
sourceimpl<T> CoordinatePosition for MultiPolygon<T> where
T: GeoNum,
impl<T> CoordinatePosition for MultiPolygon<T> where
T: GeoNum,
type Scalar = T
fn calculate_coordinate_position(
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
boundary_count: &mut usize
)
fn coordinate_position(&self, coord: &Coordinate<Self::Scalar>) -> CoordPos
sourceimpl<'a, T: CoordNum + 'a> CoordsIter<'a> for MultiPolygon<T>
impl<'a, T: CoordNum + 'a> CoordsIter<'a> for MultiPolygon<T>
sourcefn coords_count(&'a self) -> usize
fn coords_count(&'a self) -> usize
Return the number of coordinates in the MultiPolygon
.
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
sourcefn coords_iter(&'a self) -> Self::Iter
fn coords_iter(&'a self) -> Self::Iter
Iterate over all exterior and (if any) interior coordinates of a geometry. Read more
sourcefn exterior_coords_iter(&'a self) -> Self::ExteriorIter
fn exterior_coords_iter(&'a self) -> Self::ExteriorIter
Iterate over all exterior coordinates of a geometry. Read more
sourceimpl<T> Debug for MultiPolygon<T> where
T: Debug + CoordNum,
impl<T> Debug for MultiPolygon<T> where
T: Debug + CoordNum,
sourceimpl<T> Densify<T> for MultiPolygon<T> where
T: CoordFloat,
Line<T>: EuclideanLength<T>,
LineString<T>: EuclideanLength<T>,
impl<T> Densify<T> for MultiPolygon<T> where
T: CoordFloat,
Line<T>: EuclideanLength<T>,
LineString<T>: EuclideanLength<T>,
type Output = MultiPolygon<T>
fn densify(&self, max_distance: T) -> Self::Output
sourceimpl<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
sourcefn euclidean_distance(&self, other: &Line<T>) -> T
fn euclidean_distance(&self, other: &Line<T>) -> T
Returns the distance between two geometries Read more
sourceimpl<T> EuclideanDistance<T, MultiPolygon<T>> for Point<T> where
T: GeoFloat,
impl<T> EuclideanDistance<T, MultiPolygon<T>> for Point<T> where
T: GeoFloat,
sourcefn euclidean_distance(&self, mpolygon: &MultiPolygon<T>) -> T
fn euclidean_distance(&self, mpolygon: &MultiPolygon<T>) -> T
Minimum distance from a Point to a MultiPolygon
sourceimpl<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
sourcefn euclidean_distance(&self, mpolygon: &MultiPolygon<T>) -> T
fn euclidean_distance(&self, mpolygon: &MultiPolygon<T>) -> T
Returns the distance between two geometries Read more
sourceimpl<T> EuclideanDistance<T, Point<T>> for MultiPolygon<T> where
T: GeoFloat,
impl<T> EuclideanDistance<T, Point<T>> for MultiPolygon<T> where
T: GeoFloat,
sourcefn euclidean_distance(&self, point: &Point<T>) -> T
fn euclidean_distance(&self, point: &Point<T>) -> T
Minimum distance from a MultiPolygon to a Point
sourceimpl<T, IP> From<IP> for MultiPolygon<T> where
T: CoordNum,
IP: Into<Polygon<T>>,
impl<T, IP> From<IP> for MultiPolygon<T> where
T: CoordNum,
IP: Into<Polygon<T>>,
sourcefn from(x: IP) -> MultiPolygon<T>
fn from(x: IP) -> MultiPolygon<T>
Converts to this type from the input type.
sourceimpl<T> From<MultiPolygon<T>> for Geometry<T> where
T: CoordNum,
impl<T> From<MultiPolygon<T>> for Geometry<T> where
T: CoordNum,
sourcefn from(x: MultiPolygon<T>) -> Geometry<T>
fn from(x: MultiPolygon<T>) -> Geometry<T>
Converts to this type from the input type.
sourceimpl<T, IP> From<Vec<IP, Global>> for MultiPolygon<T> where
T: CoordNum,
IP: Into<Polygon<T>>,
impl<T, IP> From<Vec<IP, Global>> for MultiPolygon<T> where
T: CoordNum,
IP: Into<Polygon<T>>,
sourcefn from(x: Vec<IP, Global>) -> MultiPolygon<T>
fn from(x: Vec<IP, Global>) -> MultiPolygon<T>
Converts to this type from the input type.
sourceimpl<T, IP> FromIterator<IP> for MultiPolygon<T> where
T: CoordNum,
IP: Into<Polygon<T>>,
impl<T, IP> FromIterator<IP> for MultiPolygon<T> where
T: CoordNum,
IP: Into<Polygon<T>>,
sourcefn from_iter<I>(iter: I) -> MultiPolygon<T> where
I: IntoIterator<Item = IP>,
fn from_iter<I>(iter: I) -> MultiPolygon<T> where
I: IntoIterator<Item = IP>,
Creates a value from an iterator. Read more
sourceimpl<C: CoordNum> HasDimensions for MultiPolygon<C>
impl<C: CoordNum> HasDimensions for MultiPolygon<C>
sourcefn is_empty(&self) -> bool
fn is_empty(&self) -> bool
Some geometries, like a MultiPoint
, can have zero coordinates - we call these empty
. Read more
sourcefn dimensions(&self) -> Dimensions
fn dimensions(&self) -> Dimensions
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
sourcefn boundary_dimensions(&self) -> Dimensions
fn boundary_dimensions(&self) -> Dimensions
The dimensions of the Geometry
’s boundary, as used by OGC-SFA. Read more
sourceimpl<T> Hash for MultiPolygon<T> where
T: Hash + CoordNum,
impl<T> Hash for MultiPolygon<T> where
T: Hash + CoordNum,
sourceimpl<G, T> Intersects<G> for MultiPolygon<T> where
T: GeoNum,
Polygon<T>: Intersects<G>,
G: BoundingRect<T>,
impl<G, T> Intersects<G> for MultiPolygon<T> where
T: GeoNum,
Polygon<T>: Intersects<G>,
G: BoundingRect<T>,
fn intersects(&self, rhs: &G) -> bool
sourceimpl<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,
fn intersects(&self, rhs: &MultiPolygon<T>) -> bool
sourceimpl<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,
fn intersects(&self, rhs: &MultiPolygon<T>) -> bool
sourceimpl<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,
fn intersects(&self, rhs: &MultiPolygon<T>) -> bool
sourceimpl<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,
fn intersects(&self, rhs: &MultiPolygon<T>) -> bool
sourceimpl<'a, T> IntoIterator for &'a mut MultiPolygon<T> where
T: CoordNum,
impl<'a, T> IntoIterator for &'a mut MultiPolygon<T> where
T: CoordNum,
sourceimpl<'a, T> IntoIterator for &'a MultiPolygon<T> where
T: CoordNum,
impl<'a, T> IntoIterator for &'a MultiPolygon<T> where
T: CoordNum,
sourceimpl<T> IntoIterator for MultiPolygon<T> where
T: CoordNum,
impl<T> IntoIterator for MultiPolygon<T> where
T: CoordNum,
sourceimpl<'a, T: CoordNum + 'a> LinesIter<'a> for MultiPolygon<T>
impl<'a, T: CoordNum + 'a> LinesIter<'a> for MultiPolygon<T>
type Scalar = T
type Iter = Flatten<MapLinesIter<'a, Iter<'a, Polygon<<MultiPolygon<T> as LinesIter<'a>>::Scalar>>, Polygon<<MultiPolygon<T> as LinesIter<'a>>::Scalar>>>
sourcefn lines_iter(&'a self) -> Self::Iter
fn lines_iter(&'a self) -> Self::Iter
Iterate over all exterior and (if any) interior lines of a geometry. Read more
sourceimpl<T: CoordNum, NT: CoordNum> MapCoords<T, NT> for MultiPolygon<T>
impl<T: CoordNum, NT: CoordNum> MapCoords<T, NT> for MultiPolygon<T>
type Output = MultiPolygon<NT>
sourcefn map_coords(
&self,
func: impl Fn(Coordinate<T>) -> Coordinate<NT> + Copy
) -> Self::Output
fn map_coords(
&self,
func: impl Fn(Coordinate<T>) -> Coordinate<NT> + Copy
) -> Self::Output
Apply a function to all the coordinates in a geometric object, returning a new object. Read more
sourcefn try_map_coords<E>(
&self,
func: impl Fn(Coordinate<T>) -> Result<Coordinate<NT>, E> + Copy
) -> Result<Self::Output, E>
fn try_map_coords<E>(
&self,
func: impl Fn(Coordinate<T>) -> Result<Coordinate<NT>, E> + Copy
) -> Result<Self::Output, E>
Map a fallible function over all the coordinates in a geometry, returning a Result Read more
sourceimpl<T: CoordNum> MapCoordsInPlace<T> for MultiPolygon<T>
impl<T: CoordNum> MapCoordsInPlace<T> for MultiPolygon<T>
sourcefn map_coords_in_place(
&mut self,
func: impl Fn(Coordinate<T>) -> Coordinate<T> + Copy
)
fn map_coords_in_place(
&mut self,
func: impl Fn(Coordinate<T>) -> Coordinate<T> + Copy
)
Apply a function to all the coordinates in a geometric object, in place Read more
sourcefn try_map_coords_in_place<E>(
&mut self,
func: impl Fn(Coordinate<T>) -> Result<Coordinate<T>, E>
) -> Result<(), E>
fn try_map_coords_in_place<E>(
&mut self,
func: impl Fn(Coordinate<T>) -> Result<Coordinate<T>, E>
) -> Result<(), E>
Map a fallible function over all the coordinates in a geometry, in place, returning a Result
. Read more
sourceimpl<T: CoordNum> MapCoordsInplace<T> for MultiPolygon<T>
impl<T: CoordNum> MapCoordsInplace<T> for MultiPolygon<T>
sourcefn map_coords_inplace(&mut self, func: impl Fn((T, T)) -> (T, T) + Copy) where
T: CoordNum,
👎 Deprecated since 0.21.0: use MapCoordsInPlace::map_coords_in_place
instead which takes a Coordinate
instead of an (x,y) tuple
fn map_coords_inplace(&mut self, func: impl Fn((T, T)) -> (T, T) + Copy) where
T: CoordNum,
use MapCoordsInPlace::map_coords_in_place
instead which takes a Coordinate
instead of an (x,y) tuple
Apply a function to all the coordinates in a geometric object, in place
Examples
#[allow(deprecated)]
use geo::MapCoordsInplace;
use geo::Point;
use approx::assert_relative_eq;
let mut p = Point::new(10., 20.);
#[allow(deprecated)]
p.map_coords_inplace(|(x, y)| (x + 1000., y * 2.));
assert_relative_eq!(p, Point::new(1010., 40.), epsilon = 1e-6);
sourceimpl<T> Orient for MultiPolygon<T> where
T: GeoNum,
impl<T> Orient for MultiPolygon<T> where
T: GeoNum,
sourcefn orient(&self, direction: Direction) -> MultiPolygon<T>
fn orient(&self, direction: Direction) -> MultiPolygon<T>
Orients a Polygon’s exterior and interior rings according to convention Read more
sourceimpl<T> PartialEq<MultiPolygon<T>> for MultiPolygon<T> where
T: PartialEq<T> + CoordNum,
impl<T> PartialEq<MultiPolygon<T>> for MultiPolygon<T> where
T: PartialEq<T> + CoordNum,
sourcefn eq(&self, other: &MultiPolygon<T>) -> bool
fn eq(&self, other: &MultiPolygon<T>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &MultiPolygon<T>) -> bool
fn ne(&self, other: &MultiPolygon<T>) -> bool
This method tests for !=
.
sourceimpl<F: GeoFloat> Relate<F, GeometryCollection<F>> for MultiPolygon<F>
impl<F: GeoFloat> Relate<F, GeometryCollection<F>> for MultiPolygon<F>
fn relate(&self, other: &GeometryCollection<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, Line<F>> for MultiPolygon<F>
impl<F: GeoFloat> Relate<F, Line<F>> for MultiPolygon<F>
fn relate(&self, other: &Line<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, LineString<F>> for MultiPolygon<F>
impl<F: GeoFloat> Relate<F, LineString<F>> for MultiPolygon<F>
fn relate(&self, other: &LineString<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, MultiLineString<F>> for MultiPolygon<F>
impl<F: GeoFloat> Relate<F, MultiLineString<F>> for MultiPolygon<F>
fn relate(&self, other: &MultiLineString<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, MultiPoint<F>> for MultiPolygon<F>
impl<F: GeoFloat> Relate<F, MultiPoint<F>> for MultiPolygon<F>
fn relate(&self, other: &MultiPoint<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, MultiPolygon<F>> for Point<F>
impl<F: GeoFloat> Relate<F, MultiPolygon<F>> for Point<F>
fn relate(&self, other: &MultiPolygon<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, MultiPolygon<F>> for Line<F>
impl<F: GeoFloat> Relate<F, MultiPolygon<F>> for Line<F>
fn relate(&self, other: &MultiPolygon<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, MultiPolygon<F>> for LineString<F>
impl<F: GeoFloat> Relate<F, MultiPolygon<F>> for LineString<F>
fn relate(&self, other: &MultiPolygon<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, MultiPolygon<F>> for Polygon<F>
impl<F: GeoFloat> Relate<F, MultiPolygon<F>> for Polygon<F>
fn relate(&self, other: &MultiPolygon<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, MultiPolygon<F>> for MultiPoint<F>
impl<F: GeoFloat> Relate<F, MultiPolygon<F>> for MultiPoint<F>
fn relate(&self, other: &MultiPolygon<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, MultiPolygon<F>> for MultiLineString<F>
impl<F: GeoFloat> Relate<F, MultiPolygon<F>> for MultiLineString<F>
fn relate(&self, other: &MultiPolygon<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, MultiPolygon<F>> for MultiPolygon<F>
impl<F: GeoFloat> Relate<F, MultiPolygon<F>> for MultiPolygon<F>
fn relate(&self, other: &MultiPolygon<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, MultiPolygon<F>> for Rect<F>
impl<F: GeoFloat> Relate<F, MultiPolygon<F>> for Rect<F>
fn relate(&self, other: &MultiPolygon<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, MultiPolygon<F>> for Triangle<F>
impl<F: GeoFloat> Relate<F, MultiPolygon<F>> for Triangle<F>
fn relate(&self, other: &MultiPolygon<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, MultiPolygon<F>> for GeometryCollection<F>
impl<F: GeoFloat> Relate<F, MultiPolygon<F>> for GeometryCollection<F>
fn relate(&self, other: &MultiPolygon<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, Point<F>> for MultiPolygon<F>
impl<F: GeoFloat> Relate<F, Point<F>> for MultiPolygon<F>
fn relate(&self, other: &Point<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, Polygon<F>> for MultiPolygon<F>
impl<F: GeoFloat> Relate<F, Polygon<F>> for MultiPolygon<F>
fn relate(&self, other: &Polygon<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, Rect<F>> for MultiPolygon<F>
impl<F: GeoFloat> Relate<F, Rect<F>> for MultiPolygon<F>
fn relate(&self, other: &Rect<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, Triangle<F>> for MultiPolygon<F>
impl<F: GeoFloat> Relate<F, Triangle<F>> for MultiPolygon<F>
fn relate(&self, other: &Triangle<F>) -> IntersectionMatrix
sourceimpl<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>,
sourcefn relative_eq(
&self,
other: &MultiPolygon<T>,
epsilon: <MultiPolygon<T> as AbsDiffEq<MultiPolygon<T>>>::Epsilon,
max_relative: <MultiPolygon<T> as AbsDiffEq<MultiPolygon<T>>>::Epsilon
) -> bool
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::new(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::new(vec![b_el]);
approx::assert_relative_eq!(a, b, max_relative=0.1);
approx::assert_relative_ne!(a, b, max_relative=0.001);
sourcefn default_max_relative(
) -> <MultiPolygon<T> as AbsDiffEq<MultiPolygon<T>>>::Epsilon
fn default_max_relative(
) -> <MultiPolygon<T> as AbsDiffEq<MultiPolygon<T>>>::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
The inverse of [RelativeEq::relative_eq
].
sourceimpl<T> Rotate<T> for MultiPolygon<T> where
T: GeoFloat,
impl<T> Rotate<T> for MultiPolygon<T> where
T: GeoFloat,
sourcefn rotate_around_centroid(&self, angle: T) -> Self
fn rotate_around_centroid(&self, angle: T) -> Self
Rotate the contained Polygons about their centroids by the given number of degrees
sourcefn rotate_around_center(&self, angle: T) -> Self
fn rotate_around_center(&self, angle: T) -> Self
Rotate the MultiPolygon about the center of its bounding rectangle by the given number of degrees
sourceimpl<T> Simplify<T, T> for MultiPolygon<T> where
T: GeoFloat,
impl<T> Simplify<T, T> for MultiPolygon<T> where
T: GeoFloat,
sourcefn simplify(&self, epsilon: &T) -> Self
fn simplify(&self, epsilon: &T) -> Self
Returns the simplified representation of a geometry, using the Ramer–Douglas–Peucker algorithm Read more
sourceimpl<T> SimplifyVW<T, T> for MultiPolygon<T> where
T: CoordFloat,
impl<T> SimplifyVW<T, T> for MultiPolygon<T> where
T: CoordFloat,
sourcefn simplifyvw(&self, epsilon: &T) -> MultiPolygon<T>
fn simplifyvw(&self, epsilon: &T) -> MultiPolygon<T>
Returns the simplified representation of a geometry, using the Visvalingam-Whyatt algorithm Read more
sourceimpl<T> SimplifyVWPreserve<T, T> for MultiPolygon<T> where
T: CoordFloat + RTreeNum + HasKernel,
impl<T> SimplifyVWPreserve<T, T> for MultiPolygon<T> where
T: CoordFloat + RTreeNum + HasKernel,
sourcefn simplifyvw_preserve(&self, epsilon: &T) -> MultiPolygon<T>
fn simplifyvw_preserve(&self, epsilon: &T) -> MultiPolygon<T>
Returns the simplified representation of a geometry, using a topology-preserving variant of the Visvalingam-Whyatt algorithm. Read more
sourceimpl<T> TryFrom<Geometry<T>> for MultiPolygon<T> where
T: CoordNum,
impl<T> TryFrom<Geometry<T>> for MultiPolygon<T> where
T: CoordNum,
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.
sourceimpl<T: CoordNum, NT: CoordNum, E> TryMapCoords<T, NT, E> for MultiPolygon<T>
impl<T: CoordNum, NT: CoordNum, E> TryMapCoords<T, NT, E> for MultiPolygon<T>
type Output = MultiPolygon<NT>
type Output = MultiPolygon<NT>
use MapCoords::try_map_coords
which takes a Coordinate
instead of an (x,y) tuple
sourcefn try_map_coords(
&self,
func: impl Fn((T, T)) -> Result<(NT, NT), E> + Copy
) -> Result<Self::Output, E>
fn try_map_coords(
&self,
func: impl Fn((T, T)) -> Result<(NT, NT), E> + Copy
) -> Result<Self::Output, E>
use MapCoords::try_map_coords
which takes a Coordinate
instead of an (x,y) tuple
Map a fallible function over all the coordinates in a geometry, returning a Result Read more
sourceimpl<T: CoordNum, E> TryMapCoordsInplace<T, E> for MultiPolygon<T>
impl<T: CoordNum, E> TryMapCoordsInplace<T, E> for MultiPolygon<T>
sourcefn try_map_coords_inplace(
&mut self,
func: impl Fn((T, T)) -> Result<(T, T), E>
) -> Result<(), E>
fn try_map_coords_inplace(
&mut self,
func: impl Fn((T, T)) -> Result<(T, T), E>
) -> Result<(), E>
use MapCoordsInPlace::try_map_coords_in_place
which takes a Coordinate
instead of an (x,y) tuple
Map a fallible function over all the coordinates in a geometry, in place, returning a Result
. Read more
impl<T> Eq for MultiPolygon<T> where
T: Eq + CoordNum,
impl<T> StructuralEq for MultiPolygon<T> where
T: CoordNum,
impl<T> StructuralPartialEq for MultiPolygon<T> where
T: CoordNum,
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<G, T, U> Convert<T, U> for G where
T: CoordNum,
U: CoordNum + From<T>,
G: MapCoords<T, U>,
impl<G, T, U> Convert<T, U> for G where
T: CoordNum,
U: CoordNum + From<T>,
G: MapCoords<T, U>,
sourceimpl<'a, T, G> Extremes<'a, T> for G where
G: CoordsIter<'a, Scalar = T>,
T: CoordNum,
impl<'a, T, G> Extremes<'a, T> for G where
G: CoordsIter<'a, Scalar = T>,
T: CoordNum,
sourceimpl<T, G> RotatePoint<T> for G where
T: CoordFloat,
G: MapCoords<T, T, Output = G>,
impl<T, G> RotatePoint<T> for G where
T: CoordFloat,
G: MapCoords<T, T, Output = G>,
sourcefn rotate_around_point(&self, angle: T, point: Point<T>) -> G
fn rotate_around_point(&self, angle: T, point: Point<T>) -> G
Rotate a Geometry around an arbitrary point by an angle, given in degrees Read more
sourceimpl<T, G> Translate<T> for G where
T: CoordNum,
G: MapCoords<T, T, Output = G> + MapCoordsInPlace<T>,
impl<T, G> Translate<T> for G where
T: CoordNum,
G: MapCoords<T, T, Output = G> + MapCoordsInPlace<T>,
sourcefn translate(&self, xoff: T, yoff: T) -> G
fn translate(&self, xoff: T, yoff: T) -> G
Translate a Geometry along its axes by the given offsets Read more
sourcefn translate_in_place(&mut self, xoff: T, yoff: T)
fn translate_in_place(&mut self, xoff: T, yoff: T)
Translate a Geometry along its axes, but in place.
sourcefn translate_inplace(&mut self, xoff: T, yoff: T)
fn translate_inplace(&mut self, xoff: T, yoff: T)
renamed to translate_in_place
Translate a Geometry along its axes, but in place.