logo
pub trait LinesIter<'a> {
    type Scalar: CoordNum;
    type Iter: Iterator<Item = Line<Self::Scalar>>;

    fn lines_iter(&'a self) -> Self::Iter;
}
Expand description

Iterate over lines of a geometry.

Required Associated Types

Required Methods

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

Examples
use geo::line_string;
use geo::lines_iter::LinesIter;
use geo::{coord, Line};

let ls = line_string![
    (x: 1., y: 2.),
    (x: 23., y: 82.),
    (x: -1., y: 0.),
];

let mut iter = ls.lines_iter();
assert_eq!(
    Some(Line::new(
        coord! { x: 1., y: 2. },
        coord! { x: 23., y: 82. }
    )),
    iter.next()
);
assert_eq!(
    Some(Line::new(
        coord! { x: 23., y: 82. },
        coord! { x: -1., y: 0. }
    )),
    iter.next()
);
assert_eq!(None, iter.next());

Implementors