logo

Struct geo_types::MultiPoint[][src]

pub struct MultiPoint<T>(pub Vec<Point<T>>)
where
    T: CoordNum
;
Expand description

A collection of Points. Can be created from a Vec of Points, or from an Iterator which yields Points. Iterating over this object yields the component Points.

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

Implementations

Trait Implementations

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

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.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Feeds this value into the given Hasher. Read more

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

Iterate over the Points in this MultiPoint.

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.