pub struct GeometryCollection<T = f64>(pub Vec<Geometry<T>>)
where
T: CoordNum;
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>>
Implementations§
Source§impl<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>
Return an empty GeometryCollection
Sourcepub fn new_from(value: Vec<Geometry<T>>) -> GeometryCollection<T>
pub fn new_from(value: Vec<Geometry<T>>) -> GeometryCollection<T>
DO NOT USE!
This fn will be renamed to new
in the upcoming version.
This fn is not marked as deprecated because it would require extensive refactoring of the geo code.
Trait Implementations§
Source§impl<T> AbsDiffEq for GeometryCollection<T>
impl<T> AbsDiffEq for GeometryCollection<T>
Source§fn abs_diff_eq(
&self,
other: &GeometryCollection<T>,
epsilon: <GeometryCollection<T> as AbsDiffEq>::Epsilon,
) -> bool
fn abs_diff_eq( &self, other: &GeometryCollection<T>, epsilon: <GeometryCollection<T> as AbsDiffEq>::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);
Source§fn default_epsilon() -> <GeometryCollection<T> as AbsDiffEq>::Epsilon
fn default_epsilon() -> <GeometryCollection<T> as AbsDiffEq>::Epsilon
Source§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 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
Source§impl<T> BoundingRect<T> for GeometryCollection<T>where
T: CoordNum,
impl<T> BoundingRect<T> for GeometryCollection<T>where
T: CoordNum,
Source§impl<T> Centroid for GeometryCollection<T>where
T: GeoFloat,
impl<T> Centroid for GeometryCollection<T>where
T: GeoFloat,
Source§fn centroid(&self) -> Self::Output
fn centroid(&self) -> Self::Output
The Centroid of a GeometryCollection
is the mean of the centroids of elements, weighted
by the area of its elements.
Note that this means, that elements which have no area are not considered when calculating the centroid.
§Examples
use geo::Centroid;
use geo::{Geometry, GeometryCollection, Rect, Triangle, point, coord};
let rect_geometry = Geometry::from(Rect::new(
point!(x: 0.0f32, y: 0.0),
point!(x: 1.0, y: 1.0),
));
let triangle_geometry = Geometry::from(Triangle::new(
coord!(x: 0.0f32, y: -1.0),
coord!(x: 3.0, y: 0.0),
coord!(x: 0.0, y: 1.0),
));
let point_geometry = Geometry::from(
point!(x: 12351.0, y: 129815.0)
);
let geometry_collection = GeometryCollection::new_from(
vec![
rect_geometry,
triangle_geometry,
point_geometry
]
);
assert_eq!(
Some(point!(x: 0.875, y: 0.125)),
geometry_collection.centroid(),
);
type Output = Option<Point<T>>
Source§impl<T> ChamberlainDuquetteArea<T> for GeometryCollection<T>where
T: CoordFloat,
impl<T> ChamberlainDuquetteArea<T> for GeometryCollection<T>where
T: CoordFloat,
fn chamberlain_duquette_signed_area(&self) -> T
fn chamberlain_duquette_unsigned_area(&self) -> T
Source§impl<T> Clone for GeometryCollection<T>
impl<T> Clone for GeometryCollection<T>
Source§fn clone(&self) -> GeometryCollection<T>
fn clone(&self) -> GeometryCollection<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> for GeometryCollection<F>
impl<F: GeoFloat> ClosestPoint<F> for GeometryCollection<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<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<T> Contains<GeometryCollection<T>> for Geometry<T>where
T: GeoFloat,
impl<T> Contains<GeometryCollection<T>> for Geometry<T>where
T: GeoFloat,
fn contains(&self, geometry_collection: &GeometryCollection<T>) -> bool
Source§impl<T> Contains<GeometryCollection<T>> for Line<T>where
T: GeoFloat,
impl<T> Contains<GeometryCollection<T>> for Line<T>where
T: GeoFloat,
fn contains(&self, target: &GeometryCollection<T>) -> bool
Source§impl<T> Contains<GeometryCollection<T>> for LineString<T>where
T: GeoFloat,
impl<T> Contains<GeometryCollection<T>> for LineString<T>where
T: GeoFloat,
fn contains(&self, target: &GeometryCollection<T>) -> bool
Source§impl<T> Contains<GeometryCollection<T>> for MultiLineString<T>where
T: GeoFloat,
impl<T> Contains<GeometryCollection<T>> for MultiLineString<T>where
T: GeoFloat,
fn contains(&self, target: &GeometryCollection<T>) -> bool
Source§impl<T> Contains<GeometryCollection<T>> for MultiPoint<T>where
T: GeoFloat,
impl<T> Contains<GeometryCollection<T>> for MultiPoint<T>where
T: GeoFloat,
fn contains(&self, target: &GeometryCollection<T>) -> bool
Source§impl<T> Contains<GeometryCollection<T>> for Point<T>where
T: GeoFloat,
impl<T> Contains<GeometryCollection<T>> for Point<T>where
T: GeoFloat,
fn contains(&self, geometry_collection: &GeometryCollection<T>) -> bool
Source§impl<T> Contains<GeometryCollection<T>> for Polygon<T>where
T: GeoFloat,
impl<T> Contains<GeometryCollection<T>> for Polygon<T>where
T: GeoFloat,
fn contains(&self, target: &GeometryCollection<T>) -> bool
Source§impl<T> Contains<GeometryCollection<T>> for Rect<T>where
T: GeoFloat,
impl<T> Contains<GeometryCollection<T>> for Rect<T>where
T: GeoFloat,
fn contains(&self, target: &GeometryCollection<T>) -> bool
Source§impl<T> Contains<GeometryCollection<T>> for Triangle<T>where
T: GeoFloat,
impl<T> Contains<GeometryCollection<T>> for Triangle<T>where
T: GeoFloat,
fn contains(&self, target: &GeometryCollection<T>) -> bool
Source§impl<T> Contains<LineString<T>> for GeometryCollection<T>where
T: GeoFloat,
impl<T> Contains<LineString<T>> for GeometryCollection<T>where
T: GeoFloat,
fn contains(&self, target: &LineString<T>) -> bool
Source§impl<T> Contains<MultiLineString<T>> for GeometryCollection<T>where
T: GeoFloat,
impl<T> Contains<MultiLineString<T>> for GeometryCollection<T>where
T: GeoFloat,
fn contains(&self, target: &MultiLineString<T>) -> bool
Source§impl<T> Contains<MultiPoint<T>> for GeometryCollection<T>where
T: GeoFloat,
impl<T> Contains<MultiPoint<T>> for GeometryCollection<T>where
T: GeoFloat,
fn contains(&self, target: &MultiPoint<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 for GeometryCollection<T>where
T: GeoFloat,
impl<T> Contains for GeometryCollection<T>where
T: GeoFloat,
fn contains(&self, target: &GeometryCollection<T>) -> bool
Source§impl<T> CoordinatePosition for GeometryCollection<T>where
T: GeoNum,
impl<T> CoordinatePosition for GeometryCollection<T>where
T: GeoNum,
Source§impl<T: CoordNum> CoordsIter for GeometryCollection<T>
impl<T: CoordNum> CoordsIter for GeometryCollection<T>
Source§fn coords_count(&self) -> usize
fn coords_count(&self) -> usize
Return the number of coordinates in the GeometryCollection
.
type Iter<'a> = Box<dyn Iterator<Item = Coord<T>> + 'a> where T: 'a
type ExteriorIter<'a> = Box<dyn Iterator<Item = Coord<T>> + 'a> where T: 'a
type Scalar = T
Source§fn coords_iter(&self) -> Self::Iter<'_>
fn coords_iter(&self) -> Self::Iter<'_>
Source§fn exterior_coords_iter(&self) -> Self::ExteriorIter<'_>
fn exterior_coords_iter(&self) -> Self::ExteriorIter<'_>
Source§impl<T> Debug for GeometryCollection<T>
impl<T> Debug for GeometryCollection<T>
Source§impl<T> Default for GeometryCollection<T>where
T: CoordNum,
impl<T> Default for GeometryCollection<T>where
T: CoordNum,
Source§fn default() -> GeometryCollection<T>
fn default() -> GeometryCollection<T>
Source§impl<F> Distance<F, &Geometry<F>, &GeometryCollection<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Geometry<F>, &GeometryCollection<F>> for Euclideanwhere
F: GeoFloat,
Source§fn distance(a: &Geometry<F>, b: &GeometryCollection<F>) -> F
fn distance(a: &Geometry<F>, b: &GeometryCollection<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F: GeoFloat> Distance<F, &GeometryCollection<F>, &Geometry<F>> for Euclidean
impl<F: GeoFloat> Distance<F, &GeometryCollection<F>, &Geometry<F>> for Euclidean
Source§fn distance(origin: &GeometryCollection<F>, destination: &Geometry<F>) -> F
fn distance(origin: &GeometryCollection<F>, destination: &Geometry<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F: GeoFloat> Distance<F, &GeometryCollection<F>, &GeometryCollection<F>> for Euclidean
impl<F: GeoFloat> Distance<F, &GeometryCollection<F>, &GeometryCollection<F>> for Euclidean
Source§fn distance(
origin: &GeometryCollection<F>,
destination: &GeometryCollection<F>,
) -> F
fn distance( origin: &GeometryCollection<F>, destination: &GeometryCollection<F>, ) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F: GeoFloat> Distance<F, &GeometryCollection<F>, &Line<F>> for Euclidean
impl<F: GeoFloat> Distance<F, &GeometryCollection<F>, &Line<F>> for Euclidean
Source§fn distance(iter_geometry: &GeometryCollection<F>, to_geometry: &Line<F>) -> F
fn distance(iter_geometry: &GeometryCollection<F>, to_geometry: &Line<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F: GeoFloat> Distance<F, &GeometryCollection<F>, &LineString<F>> for Euclidean
impl<F: GeoFloat> Distance<F, &GeometryCollection<F>, &LineString<F>> for Euclidean
Source§fn distance(
iter_geometry: &GeometryCollection<F>,
to_geometry: &LineString<F>,
) -> F
fn distance( iter_geometry: &GeometryCollection<F>, to_geometry: &LineString<F>, ) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F> Distance<F, &GeometryCollection<F>, &MultiLineString<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &GeometryCollection<F>, &MultiLineString<F>> for Euclideanwhere
F: GeoFloat,
Source§fn distance(a: &GeometryCollection<F>, b: &MultiLineString<F>) -> F
fn distance(a: &GeometryCollection<F>, b: &MultiLineString<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F> Distance<F, &GeometryCollection<F>, &MultiPoint<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &GeometryCollection<F>, &MultiPoint<F>> for Euclideanwhere
F: GeoFloat,
Source§fn distance(a: &GeometryCollection<F>, b: &MultiPoint<F>) -> F
fn distance(a: &GeometryCollection<F>, b: &MultiPoint<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F> Distance<F, &GeometryCollection<F>, &MultiPolygon<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &GeometryCollection<F>, &MultiPolygon<F>> for Euclideanwhere
F: GeoFloat,
Source§fn distance(a: &GeometryCollection<F>, b: &MultiPolygon<F>) -> F
fn distance(a: &GeometryCollection<F>, b: &MultiPolygon<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F: GeoFloat> Distance<F, &GeometryCollection<F>, &Point<F>> for Euclidean
impl<F: GeoFloat> Distance<F, &GeometryCollection<F>, &Point<F>> for Euclidean
Source§fn distance(iter_geometry: &GeometryCollection<F>, to_geometry: &Point<F>) -> F
fn distance(iter_geometry: &GeometryCollection<F>, to_geometry: &Point<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F: GeoFloat> Distance<F, &GeometryCollection<F>, &Polygon<F>> for Euclidean
impl<F: GeoFloat> Distance<F, &GeometryCollection<F>, &Polygon<F>> for Euclidean
Source§fn distance(
iter_geometry: &GeometryCollection<F>,
to_geometry: &Polygon<F>,
) -> F
fn distance( iter_geometry: &GeometryCollection<F>, to_geometry: &Polygon<F>, ) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F: GeoFloat> Distance<F, &GeometryCollection<F>, &Rect<F>> for Euclidean
impl<F: GeoFloat> Distance<F, &GeometryCollection<F>, &Rect<F>> for Euclidean
Source§fn distance(iter_geometry: &GeometryCollection<F>, to_geometry: &Rect<F>) -> F
fn distance(iter_geometry: &GeometryCollection<F>, to_geometry: &Rect<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F: GeoFloat> Distance<F, &GeometryCollection<F>, &Triangle<F>> for Euclidean
impl<F: GeoFloat> Distance<F, &GeometryCollection<F>, &Triangle<F>> for Euclidean
Source§fn distance(
iter_geometry: &GeometryCollection<F>,
to_geometry: &Triangle<F>,
) -> F
fn distance( iter_geometry: &GeometryCollection<F>, to_geometry: &Triangle<F>, ) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F> Distance<F, &Line<F>, &GeometryCollection<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Line<F>, &GeometryCollection<F>> for Euclideanwhere
F: GeoFloat,
Source§fn distance(a: &Line<F>, b: &GeometryCollection<F>) -> F
fn distance(a: &Line<F>, b: &GeometryCollection<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F> Distance<F, &LineString<F>, &GeometryCollection<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &LineString<F>, &GeometryCollection<F>> for Euclideanwhere
F: GeoFloat,
Source§fn distance(a: &LineString<F>, b: &GeometryCollection<F>) -> F
fn distance(a: &LineString<F>, b: &GeometryCollection<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F: GeoFloat> Distance<F, &MultiLineString<F>, &GeometryCollection<F>> for Euclidean
impl<F: GeoFloat> Distance<F, &MultiLineString<F>, &GeometryCollection<F>> for Euclidean
Source§fn distance(
iter_geometry: &MultiLineString<F>,
to_geometry: &GeometryCollection<F>,
) -> F
fn distance( iter_geometry: &MultiLineString<F>, to_geometry: &GeometryCollection<F>, ) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F: GeoFloat> Distance<F, &MultiPoint<F>, &GeometryCollection<F>> for Euclidean
impl<F: GeoFloat> Distance<F, &MultiPoint<F>, &GeometryCollection<F>> for Euclidean
Source§fn distance(
iter_geometry: &MultiPoint<F>,
to_geometry: &GeometryCollection<F>,
) -> F
fn distance( iter_geometry: &MultiPoint<F>, to_geometry: &GeometryCollection<F>, ) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F: GeoFloat> Distance<F, &MultiPolygon<F>, &GeometryCollection<F>> for Euclidean
impl<F: GeoFloat> Distance<F, &MultiPolygon<F>, &GeometryCollection<F>> for Euclidean
Source§fn distance(
iter_geometry: &MultiPolygon<F>,
to_geometry: &GeometryCollection<F>,
) -> F
fn distance( iter_geometry: &MultiPolygon<F>, to_geometry: &GeometryCollection<F>, ) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F> Distance<F, &Point<F>, &GeometryCollection<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Point<F>, &GeometryCollection<F>> for Euclideanwhere
F: GeoFloat,
Source§fn distance(a: &Point<F>, b: &GeometryCollection<F>) -> F
fn distance(a: &Point<F>, b: &GeometryCollection<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F> Distance<F, &Polygon<F>, &GeometryCollection<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Polygon<F>, &GeometryCollection<F>> for Euclideanwhere
F: GeoFloat,
Source§fn distance(a: &Polygon<F>, b: &GeometryCollection<F>) -> F
fn distance(a: &Polygon<F>, b: &GeometryCollection<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F> Distance<F, &Rect<F>, &GeometryCollection<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Rect<F>, &GeometryCollection<F>> for Euclideanwhere
F: GeoFloat,
Source§fn distance(a: &Rect<F>, b: &GeometryCollection<F>) -> F
fn distance(a: &Rect<F>, b: &GeometryCollection<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F> Distance<F, &Triangle<F>, &GeometryCollection<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Triangle<F>, &GeometryCollection<F>> for Euclideanwhere
F: GeoFloat,
Source§fn distance(a: &Triangle<F>, b: &GeometryCollection<F>) -> F
fn distance(a: &Triangle<F>, b: &GeometryCollection<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<T> EuclideanDistance<T> for GeometryCollection<T>
impl<T> EuclideanDistance<T> for GeometryCollection<T>
Source§fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T
fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, Geometry<T>> for GeometryCollection<T>
impl<T> EuclideanDistance<T, Geometry<T>> for GeometryCollection<T>
Source§fn euclidean_distance(&self, geom: &Geometry<T>) -> T
fn euclidean_distance(&self, geom: &Geometry<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, GeometryCollection<T>> for Geometry<T>
impl<T> EuclideanDistance<T, GeometryCollection<T>> for Geometry<T>
Source§fn euclidean_distance(&self, other: &GeometryCollection<T>) -> T
fn euclidean_distance(&self, other: &GeometryCollection<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, GeometryCollection<T>> for Line<T>
impl<T> EuclideanDistance<T, GeometryCollection<T>> for Line<T>
Source§fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T
fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, GeometryCollection<T>> for LineString<T>
impl<T> EuclideanDistance<T, GeometryCollection<T>> for LineString<T>
Source§fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T
fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, GeometryCollection<T>> for MultiLineString<T>
impl<T> EuclideanDistance<T, GeometryCollection<T>> for MultiLineString<T>
Source§fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T
fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, GeometryCollection<T>> for MultiPoint<T>
impl<T> EuclideanDistance<T, GeometryCollection<T>> for MultiPoint<T>
Source§fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T
fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, GeometryCollection<T>> for MultiPolygon<T>
impl<T> EuclideanDistance<T, GeometryCollection<T>> for MultiPolygon<T>
Source§fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T
fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, GeometryCollection<T>> for Point<T>
impl<T> EuclideanDistance<T, GeometryCollection<T>> for Point<T>
Source§fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T
fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, GeometryCollection<T>> for Polygon<T>
impl<T> EuclideanDistance<T, GeometryCollection<T>> for Polygon<T>
Source§fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T
fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, GeometryCollection<T>> for Rect<T>
impl<T> EuclideanDistance<T, GeometryCollection<T>> for Rect<T>
Source§fn euclidean_distance(&self, other: &GeometryCollection<T>) -> T
fn euclidean_distance(&self, other: &GeometryCollection<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, GeometryCollection<T>> for Triangle<T>
impl<T> EuclideanDistance<T, GeometryCollection<T>> for Triangle<T>
Source§fn euclidean_distance(&self, other: &GeometryCollection<T>) -> T
fn euclidean_distance(&self, other: &GeometryCollection<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, Line<T>> for GeometryCollection<T>
impl<T> EuclideanDistance<T, Line<T>> for GeometryCollection<T>
Source§fn euclidean_distance(&self, target: &Line<T>) -> T
fn euclidean_distance(&self, target: &Line<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, LineString<T>> for GeometryCollection<T>
impl<T> EuclideanDistance<T, LineString<T>> for GeometryCollection<T>
Source§fn euclidean_distance(&self, target: &LineString<T>) -> T
fn euclidean_distance(&self, target: &LineString<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, MultiLineString<T>> for GeometryCollection<T>
impl<T> EuclideanDistance<T, MultiLineString<T>> for GeometryCollection<T>
Source§fn euclidean_distance(&self, target: &MultiLineString<T>) -> T
fn euclidean_distance(&self, target: &MultiLineString<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, MultiPoint<T>> for GeometryCollection<T>
impl<T> EuclideanDistance<T, MultiPoint<T>> for GeometryCollection<T>
Source§fn euclidean_distance(&self, target: &MultiPoint<T>) -> T
fn euclidean_distance(&self, target: &MultiPoint<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, MultiPolygon<T>> for GeometryCollection<T>
impl<T> EuclideanDistance<T, MultiPolygon<T>> for GeometryCollection<T>
Source§fn euclidean_distance(&self, target: &MultiPolygon<T>) -> T
fn euclidean_distance(&self, target: &MultiPolygon<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, Point<T>> for GeometryCollection<T>
impl<T> EuclideanDistance<T, Point<T>> for GeometryCollection<T>
Source§fn euclidean_distance(&self, target: &Point<T>) -> T
fn euclidean_distance(&self, target: &Point<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, Polygon<T>> for GeometryCollection<T>
impl<T> EuclideanDistance<T, Polygon<T>> for GeometryCollection<T>
Source§fn euclidean_distance(&self, target: &Polygon<T>) -> T
fn euclidean_distance(&self, target: &Polygon<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, Rect<T>> for GeometryCollection<T>
impl<T> EuclideanDistance<T, Rect<T>> for GeometryCollection<T>
Source§fn euclidean_distance(&self, other: &Rect<T>) -> T
fn euclidean_distance(&self, other: &Rect<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, Triangle<T>> for GeometryCollection<T>
impl<T> EuclideanDistance<T, Triangle<T>> for GeometryCollection<T>
Source§fn euclidean_distance(&self, other: &Triangle<T>) -> T
fn euclidean_distance(&self, other: &Triangle<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<'a, F: GeoFloat> From<&'a GeometryCollection<F>> for PreparedGeometry<'a, F>
impl<'a, F: GeoFloat> From<&'a GeometryCollection<F>> for PreparedGeometry<'a, F>
Source§fn from(geometry_collection: &'a GeometryCollection<F>) -> Self
fn from(geometry_collection: &'a GeometryCollection<F>) -> Self
Source§impl<'a, F: GeoFloat> From<GeometryCollection<F>> for PreparedGeometry<'a, F>
impl<'a, F: GeoFloat> From<GeometryCollection<F>> for PreparedGeometry<'a, F>
Source§fn from(geometry_collection: GeometryCollection<F>) -> Self
fn from(geometry_collection: GeometryCollection<F>) -> Self
Source§impl<T, IG> From<IG> for GeometryCollection<T>
impl<T, IG> From<IG> for GeometryCollection<T>
DO NOT USE! Deprecated since 0.7.5.
Use GeometryCollection::from(vec![geom])
instead.
Source§fn from(x: IG) -> GeometryCollection<T>
fn from(x: IG) -> GeometryCollection<T>
Source§impl<T, IG> From<Vec<IG>> for GeometryCollection<T>
impl<T, IG> From<Vec<IG>> for GeometryCollection<T>
Source§fn from(geoms: Vec<IG>) -> GeometryCollection<T>
fn from(geoms: Vec<IG>) -> GeometryCollection<T>
Source§impl<T, IG> FromIterator<IG> for GeometryCollection<T>
impl<T, IG> FromIterator<IG> for GeometryCollection<T>
Collect Geometries (or what can be converted to a Geometry) into a GeometryCollection
Source§fn 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>,
Source§impl GeodesicArea<f64> for GeometryCollection
impl GeodesicArea<f64> for GeometryCollection
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: GeoNum> HasDimensions for GeometryCollection<C>
impl<C: GeoNum> HasDimensions for GeometryCollection<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> Hash for GeometryCollection<T>
impl<T> Hash for GeometryCollection<T>
Source§impl<T> HaversineClosestPoint<T> for GeometryCollection<T>where
T: GeoFloat + FromPrimitive,
impl<T> HaversineClosestPoint<T> for GeometryCollection<T>where
T: GeoFloat + FromPrimitive,
fn haversine_closest_point(&self, from: &Point<T>) -> Closest<T>
Source§impl<T> InteriorPoint for GeometryCollection<T>where
T: GeoFloat,
impl<T> InteriorPoint for GeometryCollection<T>where
T: GeoFloat,
Source§impl<T, G> Intersects<G> for GeometryCollection<T>
impl<T, G> Intersects<G> for GeometryCollection<T>
fn intersects(&self, rhs: &G) -> bool
Source§impl<T> Intersects<GeometryCollection<T>> for Coord<T>
impl<T> Intersects<GeometryCollection<T>> for Coord<T>
fn intersects(&self, rhs: &GeometryCollection<T>) -> bool
Source§impl<T> Intersects<GeometryCollection<T>> for Line<T>
impl<T> Intersects<GeometryCollection<T>> for Line<T>
fn intersects(&self, rhs: &GeometryCollection<T>) -> bool
Source§impl<T> Intersects<GeometryCollection<T>> for Polygon<T>
impl<T> Intersects<GeometryCollection<T>> for Polygon<T>
fn intersects(&self, rhs: &GeometryCollection<T>) -> bool
Source§impl<T> Intersects<GeometryCollection<T>> for Rect<T>
impl<T> Intersects<GeometryCollection<T>> for Rect<T>
fn intersects(&self, rhs: &GeometryCollection<T>) -> bool
Source§impl<T> Intersects<GeometryCollection<T>> for Triangle<T>
impl<T> Intersects<GeometryCollection<T>> for Triangle<T>
fn intersects(&self, rhs: &GeometryCollection<T>) -> bool
Source§impl<'a, T> IntoIterator for &'a GeometryCollection<T>where
T: CoordNum,
impl<'a, T> IntoIterator for &'a GeometryCollection<T>where
T: CoordNum,
Source§impl<'a, T> IntoIterator for &'a mut GeometryCollection<T>where
T: CoordNum,
impl<'a, T> IntoIterator for &'a mut GeometryCollection<T>where
T: CoordNum,
Source§fn into_iter(self) -> <&'a mut GeometryCollection<T> as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a mut GeometryCollection<T> as IntoIterator>::IntoIter
Source§impl<T> IntoIterator for GeometryCollection<T>where
T: CoordNum,
impl<T> IntoIterator for GeometryCollection<T>where
T: CoordNum,
Source§impl<T: CoordNum, NT: CoordNum> MapCoords<T, NT> for GeometryCollection<T>
impl<T: CoordNum, NT: CoordNum> MapCoords<T, NT> for GeometryCollection<T>
Source§impl<T: CoordNum> MapCoordsInPlace<T> for GeometryCollection<T>
impl<T: CoordNum> MapCoordsInPlace<T> for GeometryCollection<T>
Source§impl<T> PartialEq for GeometryCollection<T>
impl<T> PartialEq for GeometryCollection<T>
Source§impl<F: GeoFloat> Relate<F> for GeometryCollection<F>
impl<F: GeoFloat> Relate<F> for GeometryCollection<F>
Source§fn geometry_graph(&self, arg_index: usize) -> GeometryGraph<'_, F>
fn geometry_graph(&self, arg_index: usize) -> GeometryGraph<'_, F>
GeometryGraph
fn relate(&self, other: &impl Relate<F>) -> IntersectionMatrix
Source§impl<T> RelativeEq for GeometryCollection<T>
impl<T> RelativeEq for GeometryCollection<T>
Source§fn relative_eq(
&self,
other: &GeometryCollection<T>,
epsilon: <GeometryCollection<T> as AbsDiffEq>::Epsilon,
max_relative: <GeometryCollection<T> as AbsDiffEq>::Epsilon,
) -> bool
fn relative_eq( &self, other: &GeometryCollection<T>, epsilon: <GeometryCollection<T> as AbsDiffEq>::Epsilon, max_relative: <GeometryCollection<T> as AbsDiffEq>::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);
Source§fn default_max_relative() -> <GeometryCollection<T> as AbsDiffEq>::Epsilon
fn default_max_relative() -> <GeometryCollection<T> as AbsDiffEq>::Epsilon
Source§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 GeometryCollection<T>where
T: CoordNum + FromPrimitive,
impl<T> RemoveRepeatedPoints<T> for GeometryCollection<T>where
T: CoordNum + FromPrimitive,
Source§fn remove_repeated_points(&self) -> Self
fn remove_repeated_points(&self) -> Self
Create a GeometryCollection with (consecutive) repeated points of its geometries removed.
Source§fn remove_repeated_points_mut(&mut self)
fn remove_repeated_points_mut(&mut self)
Remove (consecutive) repeated points of its geometries from a GeometryCollection inplace.
impl<T> Eq for GeometryCollection<T>
impl<T> StructuralPartialEq for GeometryCollection<T>where
T: CoordNum,
Auto Trait Implementations§
impl<T> Freeze for GeometryCollection<T>
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§
Source§impl<T, M> AffineOps<T> for M
impl<T, M> AffineOps<T> for 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<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'a, T, G> ConvexHull<'a, T> for Gwhere
T: GeoNum,
G: CoordsIter<Scalar = T>,
impl<'a, T, G> ConvexHull<'a, T> for Gwhere
T: GeoNum,
G: CoordsIter<Scalar = T>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<'a, T, G> Extremes<'a, T> for Gwhere
G: CoordsIter<Scalar = T>,
T: CoordNum,
impl<'a, T, G> Extremes<'a, T> for Gwhere
G: CoordsIter<Scalar = T>,
T: CoordNum,
Source§impl<T, G> HausdorffDistance<T> for Gwhere
T: GeoFloat,
G: CoordsIter<Scalar = T>,
impl<T, G> HausdorffDistance<T> for Gwhere
T: GeoFloat,
G: CoordsIter<Scalar = T>,
fn hausdorff_distance<Rhs>(&self, rhs: &Rhs) -> Twhere
Rhs: CoordsIter<Scalar = T>,
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>
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>
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 moreSource§impl<T, G> MinimumRotatedRect<T> for G
impl<T, G> MinimumRotatedRect<T> for G
type Scalar = T
fn minimum_rotated_rect( &self, ) -> Option<Polygon<<G as MinimumRotatedRect<T>>::Scalar>>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<G, IP, IR, T> Rotate<T> for G
impl<G, IP, IR, T> Rotate<T> for G
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
.