Struct geo::geometry::MultiPolygon
source · pub struct MultiPolygon<T = f64>(pub Vec<Polygon<T>, Global>)
where
T: CoordNum;
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§
source§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,
source§fn 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);
source§fn default_epsilon() -> <MultiPolygon<T> as AbsDiffEq<MultiPolygon<T>>>::Epsilon
fn default_epsilon() -> <MultiPolygon<T> as AbsDiffEq<MultiPolygon<T>>>::Epsilon
§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
AbsDiffEq::abs_diff_eq
].source§impl<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
source§impl<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>
source§fn clip(
&self,
ls: &MultiLineString<Self::Scalar>,
invert: bool
) -> MultiLineString<Self::Scalar>
fn clip( &self, ls: &MultiLineString<Self::Scalar>, invert: bool ) -> MultiLineString<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>
source§impl<T> BoundingRect<T> for MultiPolygon<T>where
T: CoordNum,
impl<T> BoundingRect<T> for MultiPolygon<T>where T: CoordNum,
source§impl<T> Centroid for MultiPolygon<T>where
T: GeoFloat,
impl<T> Centroid for MultiPolygon<T>where T: GeoFloat,
source§fn centroid(&self) -> Self::Output
fn centroid(&self) -> Self::Output
The Centroid of a MultiPolygon
is the mean of the centroids of its polygons, weighted
by the area of the polygons
Examples
use geo::Centroid;
use geo::{MultiPolygon, polygon, point};
let multi_polygon = MultiPolygon::new(vec![
// centroid (1.0, 0.5)
polygon![
(x: 0.0f32, y: 0.0),
(x: 2.0, y: 0.0),
(x: 2.0, y: 1.0),
(x: 0.0, y: 1.0),
],
// centroid (-0.5, 0.0)
polygon![
(x: 1.0, y: 1.0),
(x: -2.0, y: 1.0),
(x: -2.0, y: -1.0),
(x: 1.0, y: -1.0),
]
]);
assert_eq!(
// ( 2.0 * (1.0, 0.5) + 6.0 * (-0.5, 0.0) ) / 8.0
Some(point!(x: -0.125, y: 0.125)),
multi_polygon.centroid(),
);
type Output = Option<Point<T>>
source§impl<T> ChaikinSmoothing<T> for MultiPolygon<T>where
T: CoordFloat + FromPrimitive,
impl<T> ChaikinSmoothing<T> for MultiPolygon<T>where T: CoordFloat + FromPrimitive,
source§fn chaikin_smoothing(&self, n_iterations: usize) -> Self
fn chaikin_smoothing(&self, n_iterations: usize) -> Self
n_iterations
times.source§impl<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
source§impl<T> Clone for MultiPolygon<T>where
T: Clone + CoordNum,
impl<T> Clone for MultiPolygon<T>where T: Clone + CoordNum,
source§fn clone(&self) -> MultiPolygon<T>
fn clone(&self) -> MultiPolygon<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<F: GeoFloat> ClosestPoint<F, Point<F>> for MultiPolygon<F>
impl<F: GeoFloat> ClosestPoint<F, Point<F>> for MultiPolygon<F>
source§fn closest_point(&self, p: &Point<F>) -> Closest<F>
fn closest_point(&self, p: &Point<F>) -> Closest<F>
self
and p
.source§impl<T> ConcaveHull for MultiPolygon<T>where
T: GeoFloat + RTreeNum,
impl<T> ConcaveHull for MultiPolygon<T>where T: GeoFloat + RTreeNum,
source§impl<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
source§impl<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
source§impl<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
source§impl<T: GeoNum> Contains<MultiPoint<T>> for MultiPolygon<T>
impl<T: GeoNum> Contains<MultiPoint<T>> for MultiPolygon<T>
fn contains(&self, rhs: &MultiPoint<T>) -> bool
source§impl<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
source§impl<T> Contains<MultiPolygon<T>> for Geometry<T>where
T: GeoFloat,
impl<T> Contains<MultiPolygon<T>> for Geometry<T>where T: GeoFloat,
fn contains(&self, multi_line_string: &MultiPolygon<T>) -> bool
source§impl<T> Contains<MultiPolygon<T>> for GeometryCollection<T>where
T: GeoFloat,
impl<T> Contains<MultiPolygon<T>> for GeometryCollection<T>where T: GeoFloat,
fn contains(&self, target: &MultiPolygon<T>) -> bool
source§impl<T> Contains<MultiPolygon<T>> for Line<T>where
T: GeoFloat,
impl<T> Contains<MultiPolygon<T>> for Line<T>where T: GeoFloat,
fn contains(&self, target: &MultiPolygon<T>) -> bool
source§impl<T> Contains<MultiPolygon<T>> for LineString<T>where
T: GeoFloat,
impl<T> Contains<MultiPolygon<T>> for LineString<T>where T: GeoFloat,
fn contains(&self, target: &MultiPolygon<T>) -> bool
source§impl<T> Contains<MultiPolygon<T>> for MultiLineString<T>where
T: GeoFloat,
impl<T> Contains<MultiPolygon<T>> for MultiLineString<T>where T: GeoFloat,
fn contains(&self, target: &MultiPolygon<T>) -> bool
source§impl<T> Contains<MultiPolygon<T>> for MultiPoint<T>where
T: GeoFloat,
impl<T> Contains<MultiPolygon<T>> for MultiPoint<T>where T: GeoFloat,
fn contains(&self, target: &MultiPolygon<T>) -> bool
source§impl<T> Contains<MultiPolygon<T>> for Point<T>where
T: CoordNum,
impl<T> Contains<MultiPolygon<T>> for Point<T>where T: CoordNum,
fn contains(&self, multi_polygon: &MultiPolygon<T>) -> bool
source§impl<T> Contains<MultiPolygon<T>> for Polygon<T>where
T: GeoFloat,
impl<T> Contains<MultiPolygon<T>> for Polygon<T>where T: GeoFloat,
fn contains(&self, target: &MultiPolygon<T>) -> bool
source§impl<T> Contains<MultiPolygon<T>> for Rect<T>where
T: GeoFloat,
impl<T> Contains<MultiPolygon<T>> for Rect<T>where T: GeoFloat,
fn contains(&self, target: &MultiPolygon<T>) -> bool
source§impl<T> Contains<MultiPolygon<T>> for Triangle<T>where
T: GeoFloat,
impl<T> Contains<MultiPolygon<T>> for Triangle<T>where T: GeoFloat,
fn contains(&self, target: &MultiPolygon<T>) -> bool
source§impl<T> CoordinatePosition for MultiPolygon<T>where
T: GeoNum,
impl<T> CoordinatePosition for MultiPolygon<T>where T: GeoNum,
source§impl<'a, T: CoordNum + 'a> CoordsIter<'a> for MultiPolygon<T>
impl<'a, T: CoordNum + 'a> CoordsIter<'a> for MultiPolygon<T>
source§fn 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
source§fn coords_iter(&'a self) -> Self::Iter
fn coords_iter(&'a self) -> Self::Iter
source§fn exterior_coords_iter(&'a self) -> Self::ExteriorIter
fn exterior_coords_iter(&'a self) -> Self::ExteriorIter
source§impl<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>,
source§impl<'de, T> Deserialize<'de> for MultiPolygon<T>where
T: CoordNum + Deserialize<'de>,
impl<'de, T> Deserialize<'de> for MultiPolygon<T>where T: CoordNum + Deserialize<'de>,
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<MultiPolygon<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<MultiPolygon<T>, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
source§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
source§fn euclidean_distance(&self, other: &Line<T>) -> T
fn euclidean_distance(&self, other: &Line<T>) -> T
source§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
source§fn euclidean_distance(&self, mpolygon: &MultiPolygon<T>) -> T
fn euclidean_distance(&self, mpolygon: &MultiPolygon<T>) -> T
source§impl<T> EuclideanDistance<T, MultiPolygon<T>> for Point<T>where
T: GeoFloat,
impl<T> EuclideanDistance<T, MultiPolygon<T>> for Point<T>where T: GeoFloat,
source§fn euclidean_distance(&self, mpolygon: &MultiPolygon<T>) -> T
fn euclidean_distance(&self, mpolygon: &MultiPolygon<T>) -> T
Minimum distance from a Point to a MultiPolygon
source§impl<T> EuclideanDistance<T, Point<T>> for MultiPolygon<T>where
T: GeoFloat,
impl<T> EuclideanDistance<T, Point<T>> for MultiPolygon<T>where T: GeoFloat,
source§fn euclidean_distance(&self, point: &Point<T>) -> T
fn euclidean_distance(&self, point: &Point<T>) -> T
Minimum distance from a MultiPolygon to a Point
source§impl<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>>,
source§fn from(x: IP) -> MultiPolygon<T>
fn from(x: IP) -> MultiPolygon<T>
source§impl<T> From<MultiPolygon<T>> for Geometry<T>where
T: CoordNum,
impl<T> From<MultiPolygon<T>> for Geometry<T>where T: CoordNum,
source§fn from(x: MultiPolygon<T>) -> Geometry<T>
fn from(x: MultiPolygon<T>) -> Geometry<T>
source§impl<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>>,
source§impl<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>>,
source§fn 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>,
source§impl GeodesicArea<f64> for MultiPolygon
impl GeodesicArea<f64> for MultiPolygon
source§fn geodesic_perimeter(&self) -> f64
fn geodesic_perimeter(&self) -> f64
source§fn geodesic_area_signed(&self) -> f64
fn geodesic_area_signed(&self) -> f64
source§fn geodesic_area_unsigned(&self) -> f64
fn geodesic_area_unsigned(&self) -> f64
source§impl<C: CoordNum> HasDimensions for MultiPolygon<C>
impl<C: CoordNum> HasDimensions for MultiPolygon<C>
source§fn dimensions(&self) -> Dimensions
fn dimensions(&self) -> Dimensions
Rect
s are 2-dimensional, but it’s possible to create degenerate Rect
s which
have either 1 or 0 dimensions. Read moresource§fn boundary_dimensions(&self) -> Dimensions
fn boundary_dimensions(&self) -> Dimensions
Geometry
’s boundary, as used by OGC-SFA. Read moresource§impl<T> InteriorPoint for MultiPolygon<T>where
T: GeoFloat,
impl<T> InteriorPoint for MultiPolygon<T>where T: GeoFloat,
source§impl<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
source§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,
fn intersects(&self, rhs: &MultiPolygon<T>) -> bool
source§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,
fn intersects(&self, rhs: &MultiPolygon<T>) -> bool
source§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,
fn intersects(&self, rhs: &MultiPolygon<T>) -> bool
source§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,
fn intersects(&self, rhs: &MultiPolygon<T>) -> bool
source§impl<'a, T> IntoIterator for &'a MultiPolygon<T>where
T: CoordNum,
impl<'a, T> IntoIterator for &'a MultiPolygon<T>where T: CoordNum,
source§impl<'a, T> IntoIterator for &'a mut MultiPolygon<T>where
T: CoordNum,
impl<'a, T> IntoIterator for &'a mut MultiPolygon<T>where T: CoordNum,
source§impl<T> IntoIterator for MultiPolygon<T>where
T: CoordNum,
impl<T> IntoIterator for MultiPolygon<T>where T: CoordNum,
source§impl<'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>>>
source§fn lines_iter(&'a self) -> Self::Iter
fn lines_iter(&'a self) -> Self::Iter
source§impl<T: CoordNum, NT: CoordNum> MapCoords<T, NT> for MultiPolygon<T>
impl<T: CoordNum, NT: CoordNum> MapCoords<T, NT> for MultiPolygon<T>
source§impl<T: CoordNum> MapCoordsInPlace<T> for MultiPolygon<T>
impl<T: CoordNum> MapCoordsInPlace<T> for MultiPolygon<T>
source§impl<T: CoordNum> MapCoordsInplace<T> for MultiPolygon<T>
impl<T: CoordNum> MapCoordsInplace<T> for MultiPolygon<T>
source§fn 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 Coord
instead of an (x,y) tuple
fn map_coords_inplace(&mut self, func: impl Fn((T, T)) -> (T, T) + Copy)where T: CoordNum,
MapCoordsInPlace::map_coords_in_place
instead which takes a Coord
instead of an (x,y) tupleApply 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);
source§impl<T> Orient for MultiPolygon<T>where
T: GeoNum,
impl<T> Orient for MultiPolygon<T>where T: GeoNum,
source§impl<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,
source§fn eq(&self, other: &MultiPolygon<T>) -> bool
fn eq(&self, other: &MultiPolygon<T>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<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
source§impl<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
source§impl<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
source§impl<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
source§impl<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
source§impl<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
source§impl<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
source§impl<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
source§impl<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
source§impl<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
source§impl<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
source§impl<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
source§impl<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
source§impl<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
source§impl<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
source§impl<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
source§impl<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
source§impl<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
source§impl<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
source§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>,
source§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
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);
source§fn default_max_relative(
) -> <MultiPolygon<T> as AbsDiffEq<MultiPolygon<T>>>::Epsilon
fn default_max_relative( ) -> <MultiPolygon<T> as AbsDiffEq<MultiPolygon<T>>>::Epsilon
§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
RelativeEq::relative_eq
].source§impl<T> RemoveRepeatedPoints<T> for MultiPolygon<T>where
T: CoordNum + FromPrimitive,
impl<T> RemoveRepeatedPoints<T> for MultiPolygon<T>where T: CoordNum + FromPrimitive,
source§fn remove_repeated_points(&self) -> Self
fn remove_repeated_points(&self) -> Self
Create a MultiPolygon with consecutive repeated points removed.
source§fn remove_repeated_points_mut(&mut self)
fn remove_repeated_points_mut(&mut self)
Remove consecutive repeated points from a MultiPolygon inplace.
source§impl<T> Serialize for MultiPolygon<T>where
T: CoordNum + Serialize,
impl<T> Serialize for MultiPolygon<T>where T: CoordNum + Serialize,
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
source§impl<T> Simplify<T, T> for MultiPolygon<T>where
T: GeoFloat,
impl<T> Simplify<T, T> for MultiPolygon<T>where T: GeoFloat,
source§impl<T> SimplifyVw<T, T> for MultiPolygon<T>where
T: CoordFloat,
impl<T> SimplifyVw<T, T> for MultiPolygon<T>where T: CoordFloat,
source§fn simplify_vw(&self, epsilon: &T) -> MultiPolygon<T>
fn simplify_vw(&self, epsilon: &T) -> MultiPolygon<T>
source§impl<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,
source§fn simplify_vw_preserve(&self, epsilon: &T) -> MultiPolygon<T>
fn simplify_vw_preserve(&self, epsilon: &T) -> MultiPolygon<T>
source§impl<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.
source§impl<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>
MapCoords::try_map_coords
which takes a Coord
instead of an (x,y) tuplesource§fn 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>
MapCoords::try_map_coords
which takes a Coord
instead of an (x,y) tuplesource§impl<T: CoordNum, E> TryMapCoordsInplace<T, E> for MultiPolygon<T>
impl<T: CoordNum, E> TryMapCoordsInplace<T, E> for MultiPolygon<T>
source§fn 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>
MapCoordsInPlace::try_map_coords_in_place
which takes a Coord
instead of an (x,y) tupleResult
. Read moreimpl<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§
source§impl<T, M> AffineOps<T> for Mwhere
T: CoordNum,
M: MapCoordsInPlace<T> + MapCoords<T, T, Output = M>,
impl<T, M> AffineOps<T> for Mwhere T: CoordNum, M: MapCoordsInPlace<T> + MapCoords<T, T, Output = M>,
source§fn affine_transform(&self, transform: &AffineTransform<T>) -> M
fn affine_transform(&self, transform: &AffineTransform<T>) -> M
transform
immutably, outputting a new geometry.source§fn affine_transform_mut(&mut self, transform: &AffineTransform<T>)
fn affine_transform_mut(&mut self, transform: &AffineTransform<T>)
transform
to mutate self
.source§impl<G, T, U> Convert<T, U> for Gwhere
T: CoordNum,
U: CoordNum + From<T>,
G: MapCoords<T, U>,
impl<G, T, U> Convert<T, U> for Gwhere T: CoordNum, U: CoordNum + From<T>, G: MapCoords<T, U>,
source§impl<'a, T, G> ConvexHull<'a, T> for Gwhere
T: GeoNum,
G: CoordsIter<'a, Scalar = T>,
impl<'a, T, G> ConvexHull<'a, T> for Gwhere T: GeoNum, G: CoordsIter<'a, Scalar = T>,
source§impl<'a, T, G> Extremes<'a, T> for Gwhere
G: CoordsIter<'a, Scalar = T>,
T: CoordNum,
impl<'a, T, G> Extremes<'a, T> for Gwhere G: CoordsIter<'a, Scalar = T>, T: CoordNum,
source§impl<'a, T, G> MinimumRotatedRect<'a, T> for Gwhere
T: CoordFloat + GeoFloat + GeoNum,
G: CoordsIter<'a, Scalar = T>,
impl<'a, T, G> MinimumRotatedRect<'a, T> for Gwhere T: CoordFloat + GeoFloat + GeoNum, G: CoordsIter<'a, Scalar = T>,
type Scalar = T
fn minimum_rotated_rect( &'a self ) -> Option<Polygon<<G as MinimumRotatedRect<'a, T>>::Scalar>>
source§impl<G, IP, IR, T> Rotate<T> for Gwhere
T: CoordFloat,
IP: Into<Option<Point<T>>>,
IR: Into<Option<Rect<T>>>,
G: Clone + Centroid<Output = IP> + BoundingRect<T, Output = IR> + AffineOps<T>,
impl<G, IP, IR, T> Rotate<T> for Gwhere T: CoordFloat, IP: Into<Option<Point<T>>>, IR: Into<Option<Rect<T>>>, G: Clone + Centroid<Output = IP> + BoundingRect<T, Output = IR> + AffineOps<T>,
source§fn rotate_around_centroid(&self, degrees: T) -> G
fn rotate_around_centroid(&self, degrees: T) -> G
source§fn rotate_around_centroid_mut(&mut self, degrees: T)
fn rotate_around_centroid_mut(&mut self, degrees: T)
Self::rotate_around_centroid
source§fn rotate_around_center(&self, degrees: T) -> G
fn rotate_around_center(&self, degrees: T) -> G
source§fn rotate_around_center_mut(&mut self, degrees: T)
fn rotate_around_center_mut(&mut self, degrees: T)
Self::rotate_around_center
source§fn rotate_around_point(&self, degrees: T, point: Point<T>) -> G
fn rotate_around_point(&self, degrees: T, point: Point<T>) -> G
source§fn rotate_around_point_mut(&mut self, degrees: T, point: Point<T>)
fn rotate_around_point_mut(&mut self, degrees: T, point: Point<T>)
Self::rotate_around_point
source§impl<T, IR, G> Scale<T> for Gwhere
T: CoordFloat,
IR: Into<Option<Rect<T>>>,
G: Clone + AffineOps<T> + BoundingRect<T, Output = IR>,
impl<T, IR, G> Scale<T> for Gwhere T: CoordFloat, IR: Into<Option<Rect<T>>>, G: Clone + AffineOps<T> + BoundingRect<T, Output = IR>,
source§fn scale(&self, scale_factor: T) -> G
fn scale(&self, scale_factor: T) -> G
source§fn scale_xy(&self, x_factor: T, y_factor: T) -> G
fn scale_xy(&self, x_factor: T, y_factor: T) -> G
x_factor
and
y_factor
to distort the geometry’s aspect ratio. Read moresource§fn scale_xy_mut(&mut self, x_factor: T, y_factor: T)
fn scale_xy_mut(&mut self, x_factor: T, y_factor: T)
scale_xy
.source§fn scale_around_point(
&self,
x_factor: T,
y_factor: T,
origin: impl Into<Coord<T>>
) -> G
fn scale_around_point( &self, x_factor: T, y_factor: T, origin: impl Into<Coord<T>> ) -> G
origin
. Read moresource§fn scale_around_point_mut(
&mut self,
x_factor: T,
y_factor: T,
origin: impl Into<Coord<T>>
)
fn scale_around_point_mut( &mut self, x_factor: T, y_factor: T, origin: impl Into<Coord<T>> )
scale_around_point
.source§impl<T, IR, G> Skew<T> for Gwhere
T: CoordFloat,
IR: Into<Option<Rect<T>>>,
G: Clone + AffineOps<T> + BoundingRect<T, Output = IR>,
impl<T, IR, G> Skew<T> for Gwhere T: CoordFloat, IR: Into<Option<Rect<T>>>, G: Clone + AffineOps<T> + BoundingRect<T, Output = IR>,
source§fn skew(&self, degrees: T) -> G
fn skew(&self, degrees: T) -> G
source§fn skew_xy(&self, degrees_x: T, degrees_y: T) -> G
fn skew_xy(&self, degrees_x: T, degrees_y: T) -> G
source§fn skew_xy_mut(&mut self, degrees_x: T, degrees_y: T)
fn skew_xy_mut(&mut self, degrees_x: T, degrees_y: T)
skew_xy
.source§fn skew_around_point(&self, xs: T, ys: T, origin: impl Into<Coord<T>>) -> G
fn skew_around_point(&self, xs: T, ys: T, origin: impl Into<Coord<T>>) -> G
origin
, sheared by an
angle along the x and y dimensions. Read moresource§fn skew_around_point_mut(&mut self, xs: T, ys: T, origin: impl Into<Coord<T>>)
fn skew_around_point_mut(&mut self, xs: T, ys: T, origin: impl Into<Coord<T>>)
skew_around_point
.