Struct geom::FindClosest
source · [−]Expand description
A quad-tree to quickly find the closest points to some polylines.
Fields
geometries: BTreeMap<K, LineString<f64>>
quadtree: QuadTree<K>
Implementations
sourceimpl<K> FindClosest<K> where
K: Clone + Ord + Debug,
impl<K> FindClosest<K> where
K: Clone + Ord + Debug,
sourcepub fn new(bounds: &Bounds) -> FindClosest<K>
pub fn new(bounds: &Bounds) -> FindClosest<K>
Creates the quad-tree, limited to points contained in the boundary.
sourcepub fn add(&mut self, key: K, pts: &[Pt2D])
pub fn add(&mut self, key: K, pts: &[Pt2D])
Add an object to the quadtree, remembering some key associated with the points. TODO This doesn’t properly handle single points, and will silently fail by never returning any matches.
sourcepub fn all_close_pts(
&self,
query_pt: Pt2D,
max_dist_away: Distance
) -> Vec<(K, Pt2D, Distance)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn all_close_pts(
&self,
query_pt: Pt2D,
max_dist_away: Distance
) -> Vec<(K, Pt2D, Distance)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
For every object within some distance of a query point, return the (object’s key, point on the object’s polyline, distance away).
Auto Trait Implementations
impl<K> RefUnwindSafe for FindClosest<K> where
K: RefUnwindSafe,
impl<K> Send for FindClosest<K> where
K: Send,
impl<K> Sync for FindClosest<K> where
K: Sync,
impl<K> Unpin for FindClosest<K> where
K: Unpin,
impl<K> UnwindSafe for FindClosest<K> where
K: UnwindSafe + RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self