Struct geo::MultiPoint [−][src]
Expand description
A collection of Point
s. Can
be created from a Vec
of Point
s, or from an
Iterator which yields Point
s. Iterating over this
object yields the component Point
s.
Semantics
The interior and the boundary are the union of the
interior and the boundary of the constituent points. In
particular, the boundary of a MultiPoint
is always
empty.
Examples
Iterating over a MultiPoint
yields the Point
s inside.
use geo_types::{MultiPoint, Point};
let points: MultiPoint<_> = vec![(0., 0.), (1., 2.)].into();
for point in points {
println!("Point x = {}, y = {}", point.x(), point.y());
}
Tuple Fields
0: Vec<Point<T>, Global>
Implementations
Trait Implementations
impl<T> AbsDiffEq<MultiPoint<T>> for MultiPoint<T> where
T: AbsDiffEq<T, Epsilon = T> + CoordNum,
<T as AbsDiffEq<T>>::Epsilon: Copy,
impl<T> AbsDiffEq<MultiPoint<T>> for MultiPoint<T> where
T: AbsDiffEq<T, Epsilon = T> + CoordNum,
<T as AbsDiffEq<T>>::Epsilon: Copy,
pub fn abs_diff_eq(
&self,
other: &MultiPoint<T>,
epsilon: <MultiPoint<T> as AbsDiffEq<MultiPoint<T>>>::Epsilon
) -> bool
pub fn abs_diff_eq(
&self,
other: &MultiPoint<T>,
epsilon: <MultiPoint<T> as AbsDiffEq<MultiPoint<T>>>::Epsilon
) -> bool
Equality assertion with an absolute limit.
Examples
use geo_types::MultiPoint;
use geo_types::point;
let a = MultiPoint(vec![point![x: 0., y: 0.], point![x: 10., y: 10.]]);
let b = MultiPoint(vec![point![x: 0., y: 0.], point![x: 10.001, y: 10.]]);
approx::abs_diff_eq!(a, b, epsilon=0.1);
type Epsilon = T
type Epsilon = T
Used for specifying relative comparisons.
The default tolerance to use when testing values that are close together. Read more
The inverse of AbsDiffEq::abs_diff_eq
.
use geo::algorithm::centroid::Centroid;
use geo::{MultiPoint, Point};
let empty: Vec<Point<f64>> = Vec::new();
let empty_multi_points: MultiPoint<_> = empty.into();
assert_eq!(empty_multi_points.centroid(), None);
let points: MultiPoint<_> = vec![(5., 1.), (1., 3.), (3., 2.)].into();
assert_eq!(points.centroid(), Some(Point::new(3., 2.)));
Find the closest point between self
and p
.
type Scalar = T
type Scalar = T
type Scalar = T
fn calculate_coordinate_position(
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
_boundary_count: &mut usize
)
Return the number of coordinates in the MultiPoint
.
type ExteriorIter = Self::Iter
type Scalar = T
Iterate over all exterior and (if any) interior coordinates of a geometry. Read more
Iterate over all exterior coordinates of a geometry. Read more
Minimum distance from a Point to a MultiPoint
Minimum distance from a MultiPoint to a Point
Convert a single Point
(or something which can be converted to a Point
) into a
one-member MultiPoint
Performs the conversion.
Convert a Vec
of Points
(or Vec
of things which can be converted to a Point
) into a
MultiPoint
.
Collect the results of a Point
iterator into a MultiPoint
Some geometries, like a MultiPoint
, can have zero coordinates - we call these empty
. Read more
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
The dimensions of the Geometry
’s boundary, as used by OGC-SFA. Read more
impl<T> Intersects<MultiPoint<T>> for Coordinate<T> where
MultiPoint<T>: Intersects<Coordinate<T>>,
T: CoordNum,
impl<T> Intersects<MultiPoint<T>> for Coordinate<T> where
MultiPoint<T>: Intersects<Coordinate<T>>,
T: CoordNum,
impl<T> Intersects<MultiPoint<T>> for Line<T> where
MultiPoint<T>: Intersects<Line<T>>,
T: CoordNum,
impl<T> Intersects<MultiPoint<T>> for Line<T> where
MultiPoint<T>: Intersects<Line<T>>,
T: CoordNum,
impl<T> Intersects<MultiPoint<T>> for Polygon<T> where
MultiPoint<T>: Intersects<Polygon<T>>,
T: CoordNum,
impl<T> Intersects<MultiPoint<T>> for Polygon<T> where
MultiPoint<T>: Intersects<Polygon<T>>,
T: CoordNum,
impl<T> Intersects<MultiPoint<T>> for Rect<T> where
MultiPoint<T>: Intersects<Rect<T>>,
T: CoordNum,
impl<T> Intersects<MultiPoint<T>> for Rect<T> where
MultiPoint<T>: Intersects<Rect<T>>,
T: CoordNum,
Iterate over the Point
s in this MultiPoint
.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
impl<T> RelativeEq<MultiPoint<T>> for MultiPoint<T> where
T: AbsDiffEq<T, Epsilon = T> + CoordNum + RelativeEq<T>,
impl<T> RelativeEq<MultiPoint<T>> for MultiPoint<T> where
T: AbsDiffEq<T, Epsilon = T> + CoordNum + RelativeEq<T>,
pub fn relative_eq(
&self,
other: &MultiPoint<T>,
epsilon: <MultiPoint<T> as AbsDiffEq<MultiPoint<T>>>::Epsilon,
max_relative: <MultiPoint<T> as AbsDiffEq<MultiPoint<T>>>::Epsilon
) -> bool
pub fn relative_eq(
&self,
other: &MultiPoint<T>,
epsilon: <MultiPoint<T> as AbsDiffEq<MultiPoint<T>>>::Epsilon,
max_relative: <MultiPoint<T> as AbsDiffEq<MultiPoint<T>>>::Epsilon
) -> bool
Equality assertion within a relative limit.
Examples
use geo_types::MultiPoint;
use geo_types::point;
let a = MultiPoint(vec![point![x: 0., y: 0.], point![x: 10., y: 10.]]);
let b = MultiPoint(vec![point![x: 0., y: 0.], point![x: 10.001, y: 10.]]);
approx::assert_relative_eq!(a, b, max_relative=0.1)
The default relative tolerance for testing values that are far-apart. Read more
The inverse of RelativeEq::relative_eq
.
Convert a Geometry enum into its inner type.
Fails if the enum case does not match the type you are trying to convert it to.
Auto Trait Implementations
impl<T> RefUnwindSafe for MultiPoint<T> where
T: RefUnwindSafe,
impl<T> Send for MultiPoint<T> where
T: Send,
impl<T> Sync for MultiPoint<T> where
T: Sync,
impl<T> Unpin for MultiPoint<T> where
T: Unpin,
impl<T> UnwindSafe for MultiPoint<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Rotate a Geometry around an arbitrary point by an angle, given in degrees Read more