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,

source

pub fn new() -> GeometryCollection<T>

👎Deprecated: Will be replaced with a parametrized version in upcoming version. Use GeometryCollection::default() instead

Return an empty GeometryCollection

source

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.

source

pub fn len(&self) -> usize

Number of geometries in this GeometryCollection

source

pub fn is_empty(&self) -> bool

Is this GeometryCollection empty

source§

impl<'a, T> GeometryCollection<T>where T: CoordNum,

source

pub fn iter(&'a self) -> IterHelper<'a, T>

source

pub fn iter_mut(&'a mut self) -> IterMutHelper<'a, T>

Trait Implementations§

source§

impl<T> AbsDiffEq for GeometryCollection<T>where T: AbsDiffEq<Epsilon = T> + CoordNum, <T as AbsDiffEq>::Epsilon: Copy,

source§

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);
§

type Epsilon = T

Used for specifying relative comparisons.
source§

fn default_epsilon() -> <GeometryCollection<T> as AbsDiffEq>::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

The inverse of [AbsDiffEq::abs_diff_eq].
source§

impl<T> Area<T> for GeometryCollection<T>where T: CoordFloat,

source§

fn signed_area(&self) -> T

source§

fn unsigned_area(&self) -> T

source§

impl<T> BoundingRect<T> for GeometryCollection<T>where T: CoordNum,

§

type Output = Option<Rect<T>>

source§

fn bounding_rect(&self) -> Self::Output

Return the bounding rectangle of a geometry Read more
source§

impl<T> Centroid for GeometryCollection<T>where T: GeoFloat,

source§

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,

source§

impl<T> Clone for GeometryCollection<T>where T: Clone + CoordNum,

source§

fn clone(&self) -> GeometryCollection<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<F: GeoFloat> ClosestPoint<F> for GeometryCollection<F>

source§

fn closest_point(&self, p: &Point<F>) -> Closest<F>

Find the closest point between self and p.
source§

impl<T> Contains<Coord<T>> for GeometryCollection<T>where T: GeoNum,

source§

fn contains(&self, coord: &Coord<T>) -> bool

source§

impl<T> Contains<Geometry<T>> for GeometryCollection<T>where T: GeoFloat,

source§

fn contains(&self, geometry: &Geometry<T>) -> bool

source§

impl<F> Contains<GeometryCollection<F>> for MultiPolygon<F>where F: GeoFloat,

source§

impl<T> Contains<GeometryCollection<T>> for Geometry<T>where T: GeoFloat,

source§

fn contains(&self, geometry_collection: &GeometryCollection<T>) -> bool

source§

impl<T> Contains<GeometryCollection<T>> for Line<T>where T: GeoFloat,

source§

fn contains(&self, target: &GeometryCollection<T>) -> bool

source§

impl<T> Contains<GeometryCollection<T>> for LineString<T>where T: GeoFloat,

source§

fn contains(&self, target: &GeometryCollection<T>) -> bool

source§

impl<T> Contains<GeometryCollection<T>> for MultiLineString<T>where T: GeoFloat,

source§

fn contains(&self, target: &GeometryCollection<T>) -> bool

source§

impl<T> Contains<GeometryCollection<T>> for MultiPoint<T>where T: GeoFloat,

source§

fn contains(&self, target: &GeometryCollection<T>) -> bool

source§

impl<T> Contains<GeometryCollection<T>> for Point<T>where T: GeoFloat,

source§

fn contains(&self, geometry_collection: &GeometryCollection<T>) -> bool

source§

impl<T> Contains<GeometryCollection<T>> for Polygon<T>where T: GeoFloat,

source§

fn contains(&self, target: &GeometryCollection<T>) -> bool

source§

impl<T> Contains<GeometryCollection<T>> for Rect<T>where T: GeoFloat,

source§

fn contains(&self, target: &GeometryCollection<T>) -> bool

source§

impl<T> Contains<GeometryCollection<T>> for Triangle<T>where T: GeoFloat,

source§

fn contains(&self, target: &GeometryCollection<T>) -> bool

source§

impl<T> Contains<Line<T>> for GeometryCollection<T>where T: GeoFloat,

source§

fn contains(&self, target: &Line<T>) -> bool

source§

impl<T> Contains<LineString<T>> for GeometryCollection<T>where T: GeoFloat,

source§

fn contains(&self, target: &LineString<T>) -> bool

source§

impl<T> Contains<MultiLineString<T>> for GeometryCollection<T>where T: GeoFloat,

source§

fn contains(&self, target: &MultiLineString<T>) -> bool

source§

impl<T> Contains<MultiPoint<T>> for GeometryCollection<T>where T: GeoFloat,

source§

fn contains(&self, target: &MultiPoint<T>) -> bool

source§

impl<T> Contains<MultiPolygon<T>> for GeometryCollection<T>where T: GeoFloat,

source§

fn contains(&self, target: &MultiPolygon<T>) -> bool

source§

impl<T> Contains<Point<T>> for GeometryCollection<T>where T: GeoNum,

source§

fn contains(&self, point: &Point<T>) -> bool

source§

impl<T> Contains<Polygon<T>> for GeometryCollection<T>where T: GeoFloat,

source§

fn contains(&self, target: &Polygon<T>) -> bool

source§

impl<T> Contains<Rect<T>> for GeometryCollection<T>where T: GeoFloat,

source§

fn contains(&self, target: &Rect<T>) -> bool

source§

impl<T> Contains<Triangle<T>> for GeometryCollection<T>where T: GeoFloat,

source§

fn contains(&self, target: &Triangle<T>) -> bool

source§

impl<T> Contains for GeometryCollection<T>where T: GeoFloat,

source§

fn contains(&self, target: &GeometryCollection<T>) -> bool

source§

impl<T> CoordinatePosition for GeometryCollection<T>where T: GeoNum,

§

type Scalar = T

source§

fn calculate_coordinate_position( &self, coord: &Coord<T>, is_inside: &mut bool, boundary_count: &mut usize )

source§

fn coordinate_position(&self, coord: &Coord<Self::Scalar>) -> CoordPos

source§

impl<T: CoordNum> CoordsIter for GeometryCollection<T>

source§

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<'_>

Iterate over all exterior and (if any) interior coordinates of a geometry. Read more
source§

fn exterior_coords_iter(&self) -> Self::ExteriorIter<'_>

Iterate over all exterior coordinates of a geometry. Read more
source§

impl<T> Debug for GeometryCollection<T>where T: Debug + CoordNum,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<T> Default for GeometryCollection<T>where T: CoordNum,

source§

fn default() -> GeometryCollection<T>

Returns the “default value” for a type. Read more
source§

impl<T> EuclideanDistance<T> for GeometryCollection<T>where T: GeoFloat + FloatConst + RTreeNum,

source§

fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T

Returns the distance between two geometries Read more
source§

impl<T> EuclideanDistance<T, Geometry<T>> for GeometryCollection<T>where T: GeoFloat + FloatConst + RTreeNum,

source§

fn euclidean_distance(&self, geom: &Geometry<T>) -> T

Returns the distance between two geometries Read more
source§

impl<T> EuclideanDistance<T, GeometryCollection<T>> for Geometry<T>where T: GeoFloat + FloatConst + RTreeNum,

source§

fn euclidean_distance(&self, other: &GeometryCollection<T>) -> T

Returns the distance between two geometries Read more
source§

impl<T> EuclideanDistance<T, GeometryCollection<T>> for Line<T>where T: GeoFloat + FloatConst + RTreeNum,

source§

fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T

Returns the distance between two geometries Read more
source§

impl<T> EuclideanDistance<T, GeometryCollection<T>> for LineString<T>where T: GeoFloat + FloatConst + RTreeNum,

source§

fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T

Returns the distance between two geometries Read more
source§

impl<T> EuclideanDistance<T, GeometryCollection<T>> for MultiLineString<T>where T: GeoFloat + FloatConst + RTreeNum,

source§

fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T

Returns the distance between two geometries Read more
source§

impl<T> EuclideanDistance<T, GeometryCollection<T>> for MultiPoint<T>where T: GeoFloat + FloatConst + RTreeNum,

source§

fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T

Returns the distance between two geometries Read more
source§

impl<T> EuclideanDistance<T, GeometryCollection<T>> for MultiPolygon<T>where T: GeoFloat + FloatConst + RTreeNum,

source§

fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T

Returns the distance between two geometries Read more
source§

impl<T> EuclideanDistance<T, GeometryCollection<T>> for Point<T>where T: GeoFloat + FloatConst + RTreeNum,

source§

fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T

Returns the distance between two geometries Read more
source§

impl<T> EuclideanDistance<T, GeometryCollection<T>> for Polygon<T>where T: GeoFloat + FloatConst + RTreeNum,

source§

fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T

Returns the distance between two geometries Read more
source§

impl<T> EuclideanDistance<T, GeometryCollection<T>> for Rect<T>where T: GeoFloat + Signed + RTreeNum + FloatConst,

source§

fn euclidean_distance(&self, other: &GeometryCollection<T>) -> T

Returns the distance between two geometries Read more
source§

impl<T> EuclideanDistance<T, GeometryCollection<T>> for Triangle<T>where T: GeoFloat + Signed + RTreeNum + FloatConst,

source§

fn euclidean_distance(&self, other: &GeometryCollection<T>) -> T

Returns the distance between two geometries Read more
source§

impl<T> EuclideanDistance<T, Line<T>> for GeometryCollection<T>where T: GeoFloat + FloatConst + RTreeNum,

source§

fn euclidean_distance(&self, target: &Line<T>) -> T

Returns the distance between two geometries Read more
source§

impl<T> EuclideanDistance<T, LineString<T>> for GeometryCollection<T>where T: GeoFloat + FloatConst + RTreeNum,

source§

fn euclidean_distance(&self, target: &LineString<T>) -> T

Returns the distance between two geometries Read more
source§

impl<T> EuclideanDistance<T, MultiLineString<T>> for GeometryCollection<T>where T: GeoFloat + FloatConst + RTreeNum,

source§

fn euclidean_distance(&self, target: &MultiLineString<T>) -> T

Returns the distance between two geometries Read more
source§

impl<T> EuclideanDistance<T, MultiPoint<T>> for GeometryCollection<T>where T: GeoFloat + FloatConst + RTreeNum,

source§

fn euclidean_distance(&self, target: &MultiPoint<T>) -> T

Returns the distance between two geometries Read more
source§

impl<T> EuclideanDistance<T, MultiPolygon<T>> for GeometryCollection<T>where T: GeoFloat + FloatConst + RTreeNum,

source§

fn euclidean_distance(&self, target: &MultiPolygon<T>) -> T

Returns the distance between two geometries Read more
source§

impl<T> EuclideanDistance<T, Point<T>> for GeometryCollection<T>where T: GeoFloat + FloatConst + RTreeNum,

source§

fn euclidean_distance(&self, target: &Point<T>) -> T

Returns the distance between two geometries Read more
source§

impl<T> EuclideanDistance<T, Polygon<T>> for GeometryCollection<T>where T: GeoFloat + FloatConst + RTreeNum,

source§

fn euclidean_distance(&self, target: &Polygon<T>) -> T

Returns the distance between two geometries Read more
source§

impl<T> EuclideanDistance<T, Rect<T>> for GeometryCollection<T>where T: GeoFloat + Signed + RTreeNum + FloatConst,

source§

fn euclidean_distance(&self, other: &Rect<T>) -> T

Returns the distance between two geometries Read more
source§

impl<T> EuclideanDistance<T, Triangle<T>> for GeometryCollection<T>where T: GeoFloat + Signed + RTreeNum + FloatConst,

source§

fn euclidean_distance(&self, other: &Triangle<T>) -> T

Returns the distance between two geometries Read more
source§

impl<T, IG> From<IG> for GeometryCollection<T>where T: CoordNum, IG: Into<Geometry<T>>,

DO NOT USE! Deprecated since 0.7.5.

Use GeometryCollection::from(vec![geom]) instead.

source§

fn from(x: IG) -> GeometryCollection<T>

Converts to this type from the input type.
source§

impl<T, IG> From<Vec<IG>> for GeometryCollection<T>where T: CoordNum, IG: Into<Geometry<T>>,

source§

fn from(geoms: Vec<IG>) -> GeometryCollection<T>

Converts to this type from the input type.
source§

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

source§

fn from_iter<I>(iter: I) -> GeometryCollection<T>where I: IntoIterator<Item = IG>,

Creates a value from an iterator. Read more
source§

impl GeodesicArea<f64> for GeometryCollection

source§

fn geodesic_perimeter(&self) -> f64

Determine the perimeter of a geometry on an ellipsoidal model of the earth. Read more
source§

fn geodesic_area_signed(&self) -> f64

Determine the area of a geometry on an ellipsoidal model of the earth. Read more
source§

fn geodesic_area_unsigned(&self) -> f64

Determine the area of a geometry on an ellipsoidal model of the earth. Supports very large geometries that cover a significant portion of the earth. Read more
source§

fn geodesic_perimeter_area_signed(&self) -> (f64, f64)

Determine the perimeter and area of a geometry on an ellipsoidal model of the earth, all in one operation. Read more
source§

fn geodesic_perimeter_area_unsigned(&self) -> (f64, f64)

Determine the perimeter and area of a geometry on an ellipsoidal model of the earth, all in one operation. Supports very large geometries that cover a significant portion of the earth. Read more
source§

impl<C: GeoNum> HasDimensions for GeometryCollection<C>

source§

fn is_empty(&self) -> bool

Some geometries, like a MultiPoint, can have zero coordinates - we call these empty. Read more
source§

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 Rects are 2-dimensional, but it’s possible to create degenerate Rects which have either 1 or 0 dimensions. Read more
source§

fn boundary_dimensions(&self) -> Dimensions

The dimensions of the Geometry’s boundary, as used by OGC-SFA. Read more
source§

impl<T> Hash for GeometryCollection<T>where T: Hash + CoordNum,

source§

fn hash<__H>(&self, state: &mut __H)where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<T> HaversineClosestPoint<T> for GeometryCollection<T>where T: GeoFloat + FromPrimitive,

source§

fn haversine_closest_point(&self, from: &Point<T>) -> Closest<T>

source§

impl<T> Index<usize> for GeometryCollection<T>where T: CoordNum,

§

type Output = Geometry<T>

The returned type after indexing.
source§

fn index(&self, index: usize) -> &Geometry<T>

Performs the indexing (container[index]) operation. Read more
source§

impl<T> IndexMut<usize> for GeometryCollection<T>where T: CoordNum,

source§

fn index_mut(&mut self, index: usize) -> &mut Geometry<T>

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<T> InteriorPoint for GeometryCollection<T>where T: GeoFloat,

§

type Output = Option<Point<T>>

source§

fn interior_point(&self) -> Self::Output

Calculates a representative point inside the Geometry Read more
source§

impl<T, G> Intersects<G> for GeometryCollection<T>where T: CoordNum, Geometry<T>: Intersects<G>, G: BoundingRect<T>,

source§

fn intersects(&self, rhs: &G) -> bool

source§

impl<T> Intersects<GeometryCollection<T>> for Coord<T>where GeometryCollection<T>: Intersects<Coord<T>>, T: CoordNum,

source§

impl<T> Intersects<GeometryCollection<T>> for Line<T>where GeometryCollection<T>: Intersects<Line<T>>, T: CoordNum,

source§

impl<T> Intersects<GeometryCollection<T>> for Polygon<T>where GeometryCollection<T>: Intersects<Polygon<T>>, T: CoordNum,

source§

impl<T> Intersects<GeometryCollection<T>> for Rect<T>where GeometryCollection<T>: Intersects<Rect<T>>, T: CoordNum,

source§

impl<'a, T> IntoIterator for &'a GeometryCollection<T>where T: CoordNum,

§

type Item = &'a Geometry<T>

The type of the elements being iterated over.
§

type IntoIter = IterHelper<'a, T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <&'a GeometryCollection<T> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<'a, T> IntoIterator for &'a mut GeometryCollection<T>where T: CoordNum,

§

type Item = &'a mut Geometry<T>

The type of the elements being iterated over.
§

type IntoIter = IterMutHelper<'a, T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <&'a mut GeometryCollection<T> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<T> IntoIterator for GeometryCollection<T>where T: CoordNum,

§

type Item = Geometry<T>

The type of the elements being iterated over.
§

type IntoIter = IntoIteratorHelper<T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <GeometryCollection<T> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<T: CoordNum, NT: CoordNum> MapCoords<T, NT> for GeometryCollection<T>

§

type Output = GeometryCollection<NT>

source§

fn map_coords( &self, func: impl Fn(Coord<T>) -> Coord<NT> + Copy ) -> Self::Output

Apply a function to all the coordinates in a geometric object, returning a new object. Read more
source§

fn try_map_coords<E>( &self, func: impl Fn(Coord<T>) -> Result<Coord<NT>, E> + Copy ) -> Result<Self::Output, E>

Map a fallible function over all the coordinates in a geometry, returning a Result Read more
source§

impl<T: CoordNum> MapCoordsInPlace<T> for GeometryCollection<T>

source§

fn map_coords_in_place(&mut self, func: impl Fn(Coord<T>) -> Coord<T> + Copy)

Apply a function to all the coordinates in a geometric object, in place Read more
source§

fn try_map_coords_in_place<E>( &mut self, func: impl Fn(Coord<T>) -> Result<Coord<T>, E> ) -> Result<(), E>

Map a fallible function over all the coordinates in a geometry, in place, returning a Result. Read more
source§

impl<T> PartialEq for GeometryCollection<T>where T: PartialEq + CoordNum,

source§

fn eq(&self, other: &GeometryCollection<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<F: GeoFloat> Relate<F, GeometryCollection<F>> for GeometryCollection<F>

source§

impl<F: GeoFloat> Relate<F, GeometryCollection<F>> for Line<F>

source§

impl<F: GeoFloat> Relate<F, GeometryCollection<F>> for LineString<F>

source§

impl<F: GeoFloat> Relate<F, GeometryCollection<F>> for MultiLineString<F>

source§

impl<F: GeoFloat> Relate<F, GeometryCollection<F>> for MultiPoint<F>

source§

impl<F: GeoFloat> Relate<F, GeometryCollection<F>> for MultiPolygon<F>

source§

impl<F: GeoFloat> Relate<F, GeometryCollection<F>> for Point<F>

source§

impl<F: GeoFloat> Relate<F, GeometryCollection<F>> for Polygon<F>

source§

impl<F: GeoFloat> Relate<F, GeometryCollection<F>> for Rect<F>

source§

impl<F: GeoFloat> Relate<F, GeometryCollection<F>> for Triangle<F>

source§

impl<F: GeoFloat> Relate<F, Line<F>> for GeometryCollection<F>

source§

fn relate(&self, other: &Line<F>) -> IntersectionMatrix

source§

impl<F: GeoFloat> Relate<F, LineString<F>> for GeometryCollection<F>

source§

impl<F: GeoFloat> Relate<F, MultiLineString<F>> for GeometryCollection<F>

source§

impl<F: GeoFloat> Relate<F, MultiPoint<F>> for GeometryCollection<F>

source§

impl<F: GeoFloat> Relate<F, MultiPolygon<F>> for GeometryCollection<F>

source§

impl<F: GeoFloat> Relate<F, Point<F>> for GeometryCollection<F>

source§

fn relate(&self, other: &Point<F>) -> IntersectionMatrix

source§

impl<F: GeoFloat> Relate<F, Polygon<F>> for GeometryCollection<F>

source§

fn relate(&self, other: &Polygon<F>) -> IntersectionMatrix

source§

impl<F: GeoFloat> Relate<F, Rect<F>> for GeometryCollection<F>

source§

fn relate(&self, other: &Rect<F>) -> IntersectionMatrix

source§

impl<F: GeoFloat> Relate<F, Triangle<F>> for GeometryCollection<F>

source§

fn relate(&self, other: &Triangle<F>) -> IntersectionMatrix

source§

impl<T> RelativeEq for GeometryCollection<T>where T: AbsDiffEq<Epsilon = T> + CoordNum + RelativeEq,

source§

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

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

The inverse of [RelativeEq::relative_eq].
source§

impl<T> RemoveRepeatedPoints<T> for GeometryCollection<T>where T: CoordNum + FromPrimitive,

source§

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)

Remove (consecutive) repeated points of its geometries from a GeometryCollection inplace.

source§

impl<T> Eq for GeometryCollection<T>where T: Eq + CoordNum,

source§

impl<T> StructuralEq for GeometryCollection<T>where T: CoordNum,

source§

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§

source§

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

Apply transform immutably, outputting a new geometry.
source§

fn affine_transform_mut(&mut self, transform: &AffineTransform<T>)

Apply transform to mutate self.
source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<G, T, U> Convert<T, U> for Gwhere T: CoordNum, U: CoordNum + From<T>, G: MapCoords<T, U>,

§

type Output = <G as MapCoords<T, U>>::Output

source§

fn convert(&self) -> <G as Convert<T, U>>::Output

source§

impl<'a, T, G> ConvexHull<'a, T> for Gwhere T: GeoNum, G: CoordsIter<Scalar = T>,

§

type Scalar = T

source§

fn convex_hull(&'a self) -> Polygon<T>

§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<'a, T, G> Extremes<'a, T> for Gwhere G: CoordsIter<Scalar = T>, T: CoordNum,

source§

fn extremes(&'a self) -> Option<Outcome<T>>

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, G> HausdorffDistance<T> for Gwhere T: GeoFloat, G: CoordsIter<Scalar = T>,

source§

fn hausdorff_distance<Rhs>(&self, rhs: &Rhs) -> Twhere Rhs: CoordsIter<Scalar = T>,

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, G> MinimumRotatedRect<T> for Gwhere T: CoordFloat + GeoFloat + GeoNum, G: CoordsIter<Scalar = T>,

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>,

source§

fn rotate_around_centroid(&self, degrees: T) -> G

Rotate a geometry around its centroid by an angle, in degrees Read more
source§

fn rotate_around_centroid_mut(&mut self, degrees: T)

Mutable version of Self::rotate_around_centroid
source§

fn rotate_around_center(&self, degrees: T) -> G

Rotate a geometry around the center of its bounding box by an angle, in degrees. Read more
source§

fn rotate_around_center_mut(&mut self, degrees: T)

Mutable version of Self::rotate_around_center
source§

fn rotate_around_point(&self, degrees: T, point: Point<T>) -> G

Rotate a Geometry around an arbitrary point by an angle, given in degrees Read more
source§

fn rotate_around_point_mut(&mut self, degrees: T, point: Point<T>)

Mutable version of 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>,

source§

fn scale(&self, scale_factor: T) -> G

Scale a geometry from it’s bounding box center. Read more
source§

fn scale_mut(&mut self, scale_factor: T)

Mutable version of scale
source§

fn scale_xy(&self, x_factor: T, y_factor: T) -> G

Scale a geometry from it’s bounding box center, using different values for x_factor and y_factor to distort the geometry’s aspect ratio. Read more
source§

fn scale_xy_mut(&mut self, x_factor: T, y_factor: T)

Mutable version of scale_xy.
source§

fn scale_around_point( &self, x_factor: T, y_factor: T, origin: impl Into<Coord<T>> ) -> G

Scale a geometry around a point of origin. Read more
source§

fn scale_around_point_mut( &mut self, x_factor: T, y_factor: T, origin: impl Into<Coord<T>> )

Mutable version of 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>,

source§

fn skew(&self, degrees: T) -> G

An affine transformation which skews a geometry, sheared by a uniform angle along the x and y dimensions. Read more
source§

fn skew_mut(&mut self, degrees: T)

Mutable version of skew.
source§

fn skew_xy(&self, degrees_x: T, degrees_y: T) -> G

An affine transformation which skews a geometry, sheared by an angle along the x and y dimensions. Read more
source§

fn skew_xy_mut(&mut self, degrees_x: T, degrees_y: T)

Mutable version of skew_xy.
source§

fn skew_around_point(&self, xs: T, ys: T, origin: impl Into<Coord<T>>) -> G

An affine transformation which skews a geometry around a point of origin, sheared by an angle along the x and y dimensions. Read more
source§

fn skew_around_point_mut(&mut self, xs: T, ys: T, origin: impl Into<Coord<T>>)

Mutable version of skew_around_point.
source§

impl<T, G> ToDegrees<T> for Gwhere T: CoordFloat, G: MapCoords<T, T, Output = G> + MapCoordsInPlace<T>,

source§

fn to_degrees(&self) -> Self

source§

fn to_degrees_in_place(&mut self)

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, G> ToRadians<T> for Gwhere T: CoordFloat, G: MapCoords<T, T, Output = G> + MapCoordsInPlace<T>,

source§

fn to_radians(&self) -> Self

source§

fn to_radians_in_place(&mut self)

source§

impl<T, G> Translate<T> for Gwhere T: CoordNum, G: AffineOps<T>,

source§

fn translate(&self, x_offset: T, y_offset: T) -> G

Translate a Geometry along its axes by the given offsets Read more
source§

fn translate_mut(&mut self, x_offset: T, y_offset: T)

Translate a Geometry along its axes, but in place.
source§

impl<G, T, U> TryConvert<T, U> for Gwhere T: CoordNum, U: CoordNum + TryFrom<T>, G: MapCoords<T, U>,

§

type Output = Result<<G as MapCoords<T, U>>::Output, <U as TryFrom<T>>::Error>

source§

fn try_convert(&self) -> <G as TryConvert<T, U>>::Output

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<G1, G2> Within<G2> for G1where G2: Contains<G1>,

source§

fn is_within(&self, b: &G2) -> bool