pub trait SpatialArray<T: SpatialScalar, P: SpatialPoint<T>> {
// Required methods
fn len(&self) -> usize;
fn dimension(&self) -> Option<usize>;
fn get_point(&self, index: usize) -> Option<P>;
fn iter_points(&self) -> Box<dyn Iterator<Item = P> + '_>;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn bounding_box(&self) -> Option<(P, P)> { ... }
}Expand description
Trait for collections of spatial points
This trait allows algorithms to work with different array structures and iterator types while maintaining efficiency.
Required Methods§
Sourcefn iter_points(&self) -> Box<dyn Iterator<Item = P> + '_>
fn iter_points(&self) -> Box<dyn Iterator<Item = P> + '_>
Iterate over all points
Provided Methods§
Sourcefn bounding_box(&self) -> Option<(P, P)>
fn bounding_box(&self) -> Option<(P, P)>
Get the bounding box of all points