geo icon indicating copy to clipboard operation
geo copied to clipboard

Expand CoordsIter trait to allow iterating over interior and rings

Open frewsxcv opened this issue 4 years ago • 1 comments

This would allow us to make more geo algorithms generic over CoordsIter like Simplify

pub trait CoordsIter<'a> {
    type CoordsIter: Iterator<Item = Coordinate<Self::Scalar>>;

    type InteriorRingCoordsIter: Iterator<Item = Coordinate<Self::Scalar>>;

    type ExteriorRingsIter: Iterator<Item = Self::ExteriorRingCoordsIter>;
    type ExteriorRingCoordsIter: Iterator<Item = Self::Scalar>;

    type Scalar: CoordNum;

    fn coords_iter(&self) -> Self::CoordsIter;
    fn coords_count(&self) -> usize;

    fn interior_ring_coords_iter(&self) -> Self::InteriorRingCoordsIter;

    fn exterior_rings_iter(&self) -> Self::ExteriorRingsIter;
}

frewsxcv avatar Dec 05 '21 16:12 frewsxcv

An attempt was made in https://github.com/georust/geo/pull/805

frewsxcv avatar Jan 24 '23 01:01 frewsxcv