[][src]Trait geo::algorithm::coords_iter::CoordsIter

pub trait CoordsIter<'a, T: CoordinateType> {
    type Iter: Iterator<Item = Coordinate<T>>;
    pub fn coords_iter(&'a self) -> Self::Iter;
}

Iterate over geometry coordinates.

Associated Types

type Iter: Iterator<Item = Coordinate<T>>[src]

Loading content...

Required methods

pub fn coords_iter(&'a self) -> Self::Iter[src]

Iterate over all exterior and (if any) interior coordinates of a geometry.

Examples

use geo::coords_iter::CoordsIter;

let multi_point = geo::MultiPoint(vec![
    geo::point!(x: -10., y: 0.),
    geo::point!(x: 20., y: 20.),
    geo::point!(x: 30., y: 40.),
]);

let mut iter = multi_point.coords_iter();
assert_eq!(Some(geo::Coordinate { x: -10., y: 0. }), iter.next());
assert_eq!(Some(geo::Coordinate { x: 20., y: 20. }), iter.next());
assert_eq!(Some(geo::Coordinate { x: 30., y: 40. }), iter.next());
assert_eq!(None, iter.next());
Loading content...

Implementors

impl<'a, T: CoordinateType + 'a> CoordsIter<'a, T> for Geometry<T>[src]

type Iter = GeometryCoordsIter<'a, T>

impl<'a, T: CoordinateType + 'a> CoordsIter<'a, T> for GeometryCollection<T>[src]

type Iter = Box<dyn Iterator<Item = Coordinate<T>> + 'a>

impl<'a, T: CoordinateType + 'a> CoordsIter<'a, T> for LineString<T>[src]

type Iter = Copied<Iter<'a, Coordinate<T>>>

impl<'a, T: CoordinateType + 'a> CoordsIter<'a, T> for MultiLineString<T>[src]

type Iter = Flatten<MapCoordsIter<'a, T, Iter<'a, LineString<T>>, LineString<T>>>

impl<'a, T: CoordinateType + 'a> CoordsIter<'a, T> for MultiPoint<T>[src]

type Iter = Flatten<MapCoordsIter<'a, T, Iter<'a, Point<T>>, Point<T>>>

impl<'a, T: CoordinateType + 'a> CoordsIter<'a, T> for MultiPolygon<T>[src]

type Iter = Flatten<MapCoordsIter<'a, T, Iter<'a, Polygon<T>>, Polygon<T>>>

impl<'a, T: CoordinateType + 'a> CoordsIter<'a, T> for Polygon<T>[src]

type Iter = Chain<<LineString<T> as CoordsIter<'a, T>>::Iter, Flatten<MapCoordsIter<'a, T, Iter<'a, LineString<T>>, LineString<T>>>>

impl<'a, T: CoordinateType + 'a> CoordsIter<'a, T> for Rect<T>[src]

type Iter = Chain<Chain<Chain<Once<Coordinate<T>>, Once<Coordinate<T>>>, Once<Coordinate<T>>>, Once<Coordinate<T>>>

impl<'a, T: CoordinateType + 'a> CoordsIter<'a, T> for Triangle<T>[src]

type Iter = Chain<Chain<Once<Coordinate<T>>, Once<Coordinate<T>>>, Once<Coordinate<T>>>

impl<'a, T: CoordinateType> CoordsIter<'a, T> for Line<T>[src]

type Iter = Chain<Once<Coordinate<T>>, Once<Coordinate<T>>>

impl<'a, T: CoordinateType> CoordsIter<'a, T> for Point<T>[src]

type Iter = Once<Coordinate<T>>

Loading content...