Struct geo::GeometryCollection
source · [−]Expand description
A collection of Geometry
types.
It can be created from a Vec
of Geometries, or from an Iterator which yields Geometries.
Looping over this object yields its component Geometry
enum members (not the underlying geometry
primitives), and it supports iteration and indexing as
well as the various
MapCoords
functions, which are directly applied to the
underlying geometry primitives.
Examples
Looping
use std::convert::TryFrom;
use geo_types::{Point, point, Geometry, GeometryCollection};
let p = point!(x: 1.0, y: 1.0);
let pe = Geometry::Point(p);
let gc = GeometryCollection::new_from(vec![pe]);
for geom in gc {
println!("{:?}", Point::try_from(geom).unwrap().x());
}
Implements iter()
use std::convert::TryFrom;
use geo_types::{Point, point, Geometry, GeometryCollection};
let p = point!(x: 1.0, y: 1.0);
let pe = Geometry::Point(p);
let gc = GeometryCollection::new_from(vec![pe]);
gc.iter().for_each(|geom| println!("{:?}", geom));
Mutable Iteration
use std::convert::TryFrom;
use geo_types::{Point, point, Geometry, GeometryCollection};
let p = point!(x: 1.0, y: 1.0);
let pe = Geometry::Point(p);
let mut gc = GeometryCollection::new_from(vec![pe]);
gc.iter_mut().for_each(|geom| {
if let Geometry::Point(p) = geom {
p.set_x(0.2);
}
});
let updated = gc[0].clone();
assert_eq!(Point::try_from(updated).unwrap().x(), 0.2);
Indexing
use std::convert::TryFrom;
use geo_types::{Point, point, Geometry, GeometryCollection};
let p = point!(x: 1.0, y: 1.0);
let pe = Geometry::Point(p);
let gc = GeometryCollection::new_from(vec![pe]);
println!("{:?}", gc[0]);
Tuple Fields
0: Vec<Geometry<T>, Global>
Implementations
sourceimpl<T> GeometryCollection<T> where
T: CoordNum,
impl<T> GeometryCollection<T> where
T: CoordNum,
sourcepub fn new() -> GeometryCollection<T>
👎 Deprecated: Will be replaced with a parametrized version in upcoming version. Use GeometryCollection::default() instead
pub fn new() -> GeometryCollection<T>
Will be replaced with a parametrized version in upcoming version. Use GeometryCollection::default() instead
Return an empty GeometryCollection
Trait Implementations
sourceimpl<T> AbsDiffEq<GeometryCollection<T>> for GeometryCollection<T> where
T: AbsDiffEq<T, Epsilon = T> + CoordNum,
<T as AbsDiffEq<T>>::Epsilon: Copy,
impl<T> AbsDiffEq<GeometryCollection<T>> for GeometryCollection<T> where
T: AbsDiffEq<T, Epsilon = T> + CoordNum,
<T as AbsDiffEq<T>>::Epsilon: Copy,
sourcefn abs_diff_eq(
&self,
other: &GeometryCollection<T>,
epsilon: <GeometryCollection<T> as AbsDiffEq<GeometryCollection<T>>>::Epsilon
) -> bool
fn abs_diff_eq(
&self,
other: &GeometryCollection<T>,
epsilon: <GeometryCollection<T> as AbsDiffEq<GeometryCollection<T>>>::Epsilon
) -> bool
Equality assertion with an absolute limit.
Examples
use geo_types::{GeometryCollection, point};
let a = GeometryCollection::new_from(vec![point![x: 0.0, y: 0.0].into()]);
let b = GeometryCollection::new_from(vec![point![x: 0.0, y: 0.1].into()]);
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(
) -> <GeometryCollection<T> as AbsDiffEq<GeometryCollection<T>>>::Epsilon
fn default_epsilon(
) -> <GeometryCollection<T> as AbsDiffEq<GeometryCollection<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 GeometryCollection<T> where
T: CoordFloat,
impl<T> Area<T> for GeometryCollection<T> where
T: CoordFloat,
fn signed_area(&self) -> T
fn unsigned_area(&self) -> T
sourceimpl<T> BoundingRect<T> for GeometryCollection<T> where
T: CoordNum,
impl<T> BoundingRect<T> for GeometryCollection<T> where
T: CoordNum,
sourceimpl<T> Centroid for GeometryCollection<T> where
T: GeoFloat,
impl<T> Centroid for GeometryCollection<T> where
T: GeoFloat,
sourceimpl<T> ChamberlainDuquetteArea<T> for GeometryCollection<T> where
T: Float + CoordNum,
impl<T> ChamberlainDuquetteArea<T> for GeometryCollection<T> where
T: Float + CoordNum,
fn chamberlain_duquette_signed_area(&self) -> T
fn chamberlain_duquette_unsigned_area(&self) -> T
sourceimpl<T> Clone for GeometryCollection<T> where
T: Clone + CoordNum,
impl<T> Clone for GeometryCollection<T> where
T: Clone + CoordNum,
sourcefn clone(&self) -> GeometryCollection<T>
fn clone(&self) -> GeometryCollection<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 GeometryCollection<F>
impl<F: GeoFloat> ClosestPoint<F, Point<F>> for GeometryCollection<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> Contains<Coordinate<T>> for GeometryCollection<T> where
T: GeoNum,
impl<T> Contains<Coordinate<T>> for GeometryCollection<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<T> Contains<Point<T>> for GeometryCollection<T> where
T: GeoNum,
impl<T> Contains<Point<T>> for GeometryCollection<T> where
T: GeoNum,
sourceimpl<T> CoordinatePosition for GeometryCollection<T> where
T: GeoNum,
impl<T> CoordinatePosition for GeometryCollection<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 GeometryCollection<T>
impl<'a, T: CoordNum + 'a> CoordsIter<'a> for GeometryCollection<T>
sourcefn coords_count(&'a self) -> usize
fn coords_count(&'a self) -> usize
Return the number of coordinates in the GeometryCollection
.
type Iter = Box<dyn Iterator<Item = Coordinate<T>> + 'a, Global>
type ExteriorIter = Box<dyn Iterator<Item = Coordinate<T>> + 'a, Global>
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 GeometryCollection<T> where
T: Debug + CoordNum,
impl<T> Debug for GeometryCollection<T> where
T: Debug + CoordNum,
sourceimpl<T> Default for GeometryCollection<T> where
T: CoordNum,
impl<T> Default for GeometryCollection<T> where
T: CoordNum,
sourcefn default() -> GeometryCollection<T>
fn default() -> GeometryCollection<T>
Returns the “default value” for a type. Read more
sourceimpl<T, IG> From<IG> for GeometryCollection<T> where
T: CoordNum,
IG: Into<Geometry<T>>,
impl<T, IG> From<IG> for GeometryCollection<T> where
T: CoordNum,
IG: Into<Geometry<T>>,
sourcefn from(x: IG) -> GeometryCollection<T>
fn from(x: IG) -> GeometryCollection<T>
Converts to this type from the input type.
sourceimpl<T, IG> From<Vec<IG, Global>> for GeometryCollection<T> where
T: CoordNum,
IG: Into<Geometry<T>>,
impl<T, IG> From<Vec<IG, Global>> for GeometryCollection<T> where
T: CoordNum,
IG: Into<Geometry<T>>,
sourcefn from(geoms: Vec<IG, Global>) -> GeometryCollection<T>
fn from(geoms: Vec<IG, Global>) -> GeometryCollection<T>
Converts to this type from the input type.
sourceimpl<T, IG> FromIterator<IG> for GeometryCollection<T> where
T: CoordNum,
IG: Into<Geometry<T>>,
impl<T, IG> FromIterator<IG> for GeometryCollection<T> where
T: CoordNum,
IG: Into<Geometry<T>>,
Collect Geometries (or what can be converted to a Geometry) into a GeometryCollection
sourcefn from_iter<I>(iter: I) -> GeometryCollection<T> where
I: IntoIterator<Item = IG>,
fn from_iter<I>(iter: I) -> GeometryCollection<T> where
I: IntoIterator<Item = IG>,
Creates a value from an iterator. Read more
sourceimpl<C: GeoNum> HasDimensions for GeometryCollection<C>
impl<C: GeoNum> HasDimensions for GeometryCollection<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 GeometryCollection<T> where
T: Hash + CoordNum,
impl<T> Hash for GeometryCollection<T> where
T: Hash + CoordNum,
sourceimpl<T> Index<usize> for GeometryCollection<T> where
T: CoordNum,
impl<T> Index<usize> for GeometryCollection<T> where
T: CoordNum,
sourceimpl<T> IndexMut<usize> for GeometryCollection<T> where
T: CoordNum,
impl<T> IndexMut<usize> for GeometryCollection<T> where
T: CoordNum,
sourceimpl<T, G> Intersects<G> for GeometryCollection<T> where
T: CoordNum,
Geometry<T>: Intersects<G>,
G: BoundingRect<T>,
impl<T, G> Intersects<G> for GeometryCollection<T> where
T: CoordNum,
Geometry<T>: Intersects<G>,
G: BoundingRect<T>,
fn intersects(&self, rhs: &G) -> bool
sourceimpl<T> Intersects<GeometryCollection<T>> for Coordinate<T> where
GeometryCollection<T>: Intersects<Coordinate<T>>,
T: CoordNum,
impl<T> Intersects<GeometryCollection<T>> for Coordinate<T> where
GeometryCollection<T>: Intersects<Coordinate<T>>,
T: CoordNum,
fn intersects(&self, rhs: &GeometryCollection<T>) -> bool
sourceimpl<T> Intersects<GeometryCollection<T>> for Line<T> where
GeometryCollection<T>: Intersects<Line<T>>,
T: CoordNum,
impl<T> Intersects<GeometryCollection<T>> for Line<T> where
GeometryCollection<T>: Intersects<Line<T>>,
T: CoordNum,
fn intersects(&self, rhs: &GeometryCollection<T>) -> bool
sourceimpl<T> Intersects<GeometryCollection<T>> for Rect<T> where
GeometryCollection<T>: Intersects<Rect<T>>,
T: CoordNum,
impl<T> Intersects<GeometryCollection<T>> for Rect<T> where
GeometryCollection<T>: Intersects<Rect<T>>,
T: CoordNum,
fn intersects(&self, rhs: &GeometryCollection<T>) -> bool
sourceimpl<T> Intersects<GeometryCollection<T>> for Polygon<T> where
GeometryCollection<T>: Intersects<Polygon<T>>,
T: CoordNum,
impl<T> Intersects<GeometryCollection<T>> for Polygon<T> where
GeometryCollection<T>: Intersects<Polygon<T>>,
T: CoordNum,
fn intersects(&self, rhs: &GeometryCollection<T>) -> bool
sourceimpl<'a, T> IntoIterator for &'a mut GeometryCollection<T> where
T: CoordNum,
impl<'a, T> IntoIterator for &'a mut GeometryCollection<T> where
T: CoordNum,
type IntoIter = IterMutHelper<'a, T>
type IntoIter = IterMutHelper<'a, T>
Which kind of iterator are we turning this into?
sourcefn into_iter(self) -> <&'a mut GeometryCollection<T> as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a mut GeometryCollection<T> as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
sourceimpl<'a, T> IntoIterator for &'a GeometryCollection<T> where
T: CoordNum,
impl<'a, T> IntoIterator for &'a GeometryCollection<T> where
T: CoordNum,
type IntoIter = IterHelper<'a, T>
type IntoIter = IterHelper<'a, T>
Which kind of iterator are we turning this into?
sourcefn into_iter(self) -> <&'a GeometryCollection<T> as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a GeometryCollection<T> as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
sourceimpl<T> IntoIterator for GeometryCollection<T> where
T: CoordNum,
impl<T> IntoIterator for GeometryCollection<T> where
T: CoordNum,
type IntoIter = IntoIteratorHelper<T>
type IntoIter = IntoIteratorHelper<T>
Which kind of iterator are we turning this into?
sourcefn into_iter(self) -> <GeometryCollection<T> as IntoIterator>::IntoIter
fn into_iter(self) -> <GeometryCollection<T> as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
sourceimpl<T: CoordNum, NT: CoordNum> MapCoords<T, NT> for GeometryCollection<T>
impl<T: CoordNum, NT: CoordNum> MapCoords<T, NT> for GeometryCollection<T>
type Output = GeometryCollection<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 GeometryCollection<T>
impl<T: CoordNum> MapCoordsInPlace<T> for GeometryCollection<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 GeometryCollection<T>
impl<T: CoordNum> MapCoordsInplace<T> for GeometryCollection<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> PartialEq<GeometryCollection<T>> for GeometryCollection<T> where
T: PartialEq<T> + CoordNum,
impl<T> PartialEq<GeometryCollection<T>> for GeometryCollection<T> where
T: PartialEq<T> + CoordNum,
sourcefn eq(&self, other: &GeometryCollection<T>) -> bool
fn eq(&self, other: &GeometryCollection<T>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &GeometryCollection<T>) -> bool
fn ne(&self, other: &GeometryCollection<T>) -> bool
This method tests for !=
.
sourceimpl<F: GeoFloat> Relate<F, GeometryCollection<F>> for Point<F>
impl<F: GeoFloat> Relate<F, GeometryCollection<F>> for Point<F>
fn relate(&self, other: &GeometryCollection<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, GeometryCollection<F>> for Line<F>
impl<F: GeoFloat> Relate<F, GeometryCollection<F>> for Line<F>
fn relate(&self, other: &GeometryCollection<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, GeometryCollection<F>> for LineString<F>
impl<F: GeoFloat> Relate<F, GeometryCollection<F>> for LineString<F>
fn relate(&self, other: &GeometryCollection<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, GeometryCollection<F>> for Polygon<F>
impl<F: GeoFloat> Relate<F, GeometryCollection<F>> for Polygon<F>
fn relate(&self, other: &GeometryCollection<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, GeometryCollection<F>> for MultiPoint<F>
impl<F: GeoFloat> Relate<F, GeometryCollection<F>> for MultiPoint<F>
fn relate(&self, other: &GeometryCollection<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, GeometryCollection<F>> for MultiLineString<F>
impl<F: GeoFloat> Relate<F, GeometryCollection<F>> for MultiLineString<F>
fn relate(&self, other: &GeometryCollection<F>) -> IntersectionMatrix
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, GeometryCollection<F>> for Rect<F>
impl<F: GeoFloat> Relate<F, GeometryCollection<F>> for Rect<F>
fn relate(&self, other: &GeometryCollection<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, GeometryCollection<F>> for Triangle<F>
impl<F: GeoFloat> Relate<F, GeometryCollection<F>> for Triangle<F>
fn relate(&self, other: &GeometryCollection<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, GeometryCollection<F>> for GeometryCollection<F>
impl<F: GeoFloat> Relate<F, GeometryCollection<F>> for GeometryCollection<F>
fn relate(&self, other: &GeometryCollection<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, Line<F>> for GeometryCollection<F>
impl<F: GeoFloat> Relate<F, Line<F>> for GeometryCollection<F>
fn relate(&self, other: &Line<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, LineString<F>> for GeometryCollection<F>
impl<F: GeoFloat> Relate<F, LineString<F>> for GeometryCollection<F>
fn relate(&self, other: &LineString<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, MultiLineString<F>> for GeometryCollection<F>
impl<F: GeoFloat> Relate<F, MultiLineString<F>> for GeometryCollection<F>
fn relate(&self, other: &MultiLineString<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, MultiPoint<F>> for GeometryCollection<F>
impl<F: GeoFloat> Relate<F, MultiPoint<F>> for GeometryCollection<F>
fn relate(&self, other: &MultiPoint<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 GeometryCollection<F>
impl<F: GeoFloat> Relate<F, Point<F>> for GeometryCollection<F>
fn relate(&self, other: &Point<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, Polygon<F>> for GeometryCollection<F>
impl<F: GeoFloat> Relate<F, Polygon<F>> for GeometryCollection<F>
fn relate(&self, other: &Polygon<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, Rect<F>> for GeometryCollection<F>
impl<F: GeoFloat> Relate<F, Rect<F>> for GeometryCollection<F>
fn relate(&self, other: &Rect<F>) -> IntersectionMatrix
sourceimpl<F: GeoFloat> Relate<F, Triangle<F>> for GeometryCollection<F>
impl<F: GeoFloat> Relate<F, Triangle<F>> for GeometryCollection<F>
fn relate(&self, other: &Triangle<F>) -> IntersectionMatrix
sourceimpl<T> RelativeEq<GeometryCollection<T>> for GeometryCollection<T> where
T: AbsDiffEq<T, Epsilon = T> + CoordNum + RelativeEq<T>,
impl<T> RelativeEq<GeometryCollection<T>> for GeometryCollection<T> where
T: AbsDiffEq<T, Epsilon = T> + CoordNum + RelativeEq<T>,
sourcefn relative_eq(
&self,
other: &GeometryCollection<T>,
epsilon: <GeometryCollection<T> as AbsDiffEq<GeometryCollection<T>>>::Epsilon,
max_relative: <GeometryCollection<T> as AbsDiffEq<GeometryCollection<T>>>::Epsilon
) -> bool
fn relative_eq(
&self,
other: &GeometryCollection<T>,
epsilon: <GeometryCollection<T> as AbsDiffEq<GeometryCollection<T>>>::Epsilon,
max_relative: <GeometryCollection<T> as AbsDiffEq<GeometryCollection<T>>>::Epsilon
) -> bool
Equality assertion within a relative limit.
Examples
use geo_types::{GeometryCollection, point};
let a = GeometryCollection::new_from(vec![point![x: 1.0, y: 2.0].into()]);
let b = GeometryCollection::new_from(vec![point![x: 1.0, y: 2.01].into()]);
approx::assert_relative_eq!(a, b, max_relative=0.1);
approx::assert_relative_ne!(a, b, max_relative=0.0001);
sourcefn default_max_relative(
) -> <GeometryCollection<T> as AbsDiffEq<GeometryCollection<T>>>::Epsilon
fn default_max_relative(
) -> <GeometryCollection<T> as AbsDiffEq<GeometryCollection<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: CoordNum, NT: CoordNum, E> TryMapCoords<T, NT, E> for GeometryCollection<T>
impl<T: CoordNum, NT: CoordNum, E> TryMapCoords<T, NT, E> for GeometryCollection<T>
type Output = GeometryCollection<NT>
type Output = GeometryCollection<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 GeometryCollection<T>
impl<T: CoordNum, E> TryMapCoordsInplace<T, E> for GeometryCollection<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 GeometryCollection<T> where
T: Eq + CoordNum,
impl<T> StructuralEq for GeometryCollection<T> where
T: CoordNum,
impl<T> StructuralPartialEq for GeometryCollection<T> where
T: CoordNum,
Auto Trait Implementations
impl<T> RefUnwindSafe for GeometryCollection<T> where
T: RefUnwindSafe,
impl<T> Send for GeometryCollection<T> where
T: Send,
impl<T> Sync for GeometryCollection<T> where
T: Sync,
impl<T> Unpin for GeometryCollection<T> where
T: Unpin,
impl<T> UnwindSafe for GeometryCollection<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.