[][src]Struct geom::FindClosest

pub struct FindClosest<K> {
    geometries: BTreeMap<K, LineString<f64>>,
    quadtree: QuadTree<K>,
}

A quad-tree to quickly find the closest points to some polylines.

Fields

geometries: BTreeMap<K, LineString<f64>>quadtree: QuadTree<K>

Implementations

impl<K> FindClosest<K> where
    K: Clone + Ord + Debug
[src]

pub fn new(bounds: &Bounds) -> FindClosest<K>[src]

Creates the quad-tree, limited to points contained in the boundary.

pub fn add(&mut self, key: K, pts: &Vec<Pt2D>)[src]

Add an object to the quadtree, remembering some key associated with the points.

pub fn all_close_pts(
    &self,
    query_pt: Pt2D,
    max_dist_away: Distance
) -> Vec<(K, Pt2D, Distance)>
[src]

For every object within some distance of a query point, return the (object's key, point on the object's polyline, distance away).

pub fn closest_pt(
    &self,
    query_pt: Pt2D,
    max_dist_away: Distance
) -> Option<(K, Pt2D)>
[src]

Finds the closest point on the existing geometry to the query pt.

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: RefUnwindSafe + UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.