pub struct MultiPolygonGeometry(pub Vec<PolygonGeometry>);Expand description
Represents a collection of polygons, each of which may have an outer ring and optional inner holes. This struct is used for complex, multi-part areas in 2D space.
Tuple Fields§
§0: Vec<PolygonGeometry>Trait Implementations§
Source§impl Clone for MultiPolygonGeometry
impl Clone for MultiPolygonGeometry
Source§fn clone(&self) -> MultiPolygonGeometry
fn clone(&self) -> MultiPolygonGeometry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl CompositeGeometryTrait<PolygonGeometry> for MultiPolygonGeometry
Implementation of CompositeGeometryTrait for MultiPolygonGeometry.
impl CompositeGeometryTrait<PolygonGeometry> for MultiPolygonGeometry
Implementation of CompositeGeometryTrait for MultiPolygonGeometry.
Provides methods for working with the internal list of PolygonGeometry objects.
new()creates an emptyMultiPolygonGeometry.as_vec()returns an immutable reference to the internal polygons.as_mut_vec()returns a mutable reference to the internal polygons.into_inner()consumes the geometry and returns the vector of polygons.
Source§fn as_vec(&self) -> &Vec<PolygonGeometry>
fn as_vec(&self) -> &Vec<PolygonGeometry>
Returns an immutable reference to the inner collection of elements.
Source§fn as_mut_vec(&mut self) -> &mut Vec<PolygonGeometry>
fn as_mut_vec(&mut self) -> &mut Vec<PolygonGeometry>
Returns a mutable reference to the inner collection of elements.
Source§fn into_inner(self) -> Vec<PolygonGeometry>
fn into_inner(self) -> Vec<PolygonGeometry>
Consumes the composite geometry and returns the inner collection of elements.
Source§fn into_iter(self) -> impl Iterator<Item = Item>
fn into_iter(self) -> impl Iterator<Item = Item>
Returns an iterator over owned elements of the composite geometry.
Source§fn into_first_and_rest(self) -> Option<(Item, Vec<Item>)>
fn into_first_and_rest(self) -> Option<(Item, Vec<Item>)>
Splits the composite geometry into its first element and the rest, if available.
Source§fn pop(&mut self) -> Option<Item>
fn pop(&mut self) -> Option<Item>
Removes and returns the last element from the composite geometry, if any.
Source§impl Debug for MultiPolygonGeometry
Implementation of Debug for MultiPolygonGeometry.
impl Debug for MultiPolygonGeometry
Implementation of Debug for MultiPolygonGeometry.
Prints the list of polygons in a developer-friendly format.
Source§impl<'a, T> From<&'a [T]> for MultiPolygonGeometry
impl<'a, T> From<&'a [T]> for MultiPolygonGeometry
Source§impl<'a, T> From<&'a Vec<T>> for MultiPolygonGeometry
impl<'a, T> From<&'a Vec<T>> for MultiPolygonGeometry
Source§impl<T> From<Vec<T>> for MultiPolygonGeometrywhere
PolygonGeometry: From<T>,
impl<T> From<Vec<T>> for MultiPolygonGeometrywhere
PolygonGeometry: From<T>,
Source§impl GeometryTrait for MultiPolygonGeometry
Implementation of GeometryTrait for MultiPolygonGeometry.
impl GeometryTrait for MultiPolygonGeometry
Implementation of GeometryTrait for MultiPolygonGeometry.
area()returns the sum of all polygon areas.verify()checks that each polygon is valid.to_coord_json()converts the geometry into a JSON array of polygons, optionally rounding coordinates to a given precision.
Source§fn area(&self) -> f64
fn area(&self) -> f64
Returns the geometric area of the geometry.
For non-area geometries (e.g., points or lines), this returns 0.
Source§fn verify(&self) -> Result<()>
fn verify(&self) -> Result<()>
Verifies the geometric validity of the geometry.
For example, checks if there are enough points or if polygons are properly closed.
Returns an error if the geometry is invalid.
Source§fn to_coord_json(&self, precision: Option<u8>) -> JsonValue
fn to_coord_json(&self, precision: Option<u8>) -> JsonValue
Converts the geometry into a JSON representation of its coordinates.
Optionally rounds coordinate values to the given precision.
Source§fn contains_point(&self, x: f64, y: f64) -> bool
fn contains_point(&self, x: f64, y: f64) -> bool
Checks if a point is inside this geometry. Read more
Source§fn to_mercator(&self) -> MultiPolygonGeometry
fn to_mercator(&self) -> MultiPolygonGeometry
Transform this geometry from WGS84 to Web Mercator coordinates. Read more
Source§impl PartialEq for MultiPolygonGeometry
impl PartialEq for MultiPolygonGeometry
Source§impl SingleGeometryTrait<MultiPolygonGeometry> for PolygonGeometry
impl SingleGeometryTrait<MultiPolygonGeometry> for PolygonGeometry
Source§fn into_multi(self) -> MultiPolygonGeometry
fn into_multi(self) -> MultiPolygonGeometry
Wraps this polygon into a MultiPolygonGeometry.
impl StructuralPartialEq for MultiPolygonGeometry
Auto Trait Implementations§
impl Freeze for MultiPolygonGeometry
impl RefUnwindSafe for MultiPolygonGeometry
impl Send for MultiPolygonGeometry
impl Sync for MultiPolygonGeometry
impl Unpin for MultiPolygonGeometry
impl UnsafeUnpin for MultiPolygonGeometry
impl UnwindSafe for MultiPolygonGeometry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more