geo
geo copied to clipboard
Expand CoordsIter trait to allow iterating over interior and rings
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;
}
An attempt was made in https://github.com/georust/geo/pull/805