[][src]Struct kdbush::KDBush

pub struct KDBush { /* fields omitted */ }

A very fast static spatial index for 2D points based on a flat KD-tree

Methods

impl KDBush[src]

pub fn create<R: PointReader>(points: R, node_size: u8) -> KDBush[src]

Creates an index from the given points

Arguments

  • points - Input points reader
  • node_size - Size of the KD-tree node, 64 by default. Higher means faster indexing but slower search, and vise versa

pub fn new(size_hint: usize, node_size: u8) -> KDBush[src]

Creates an empty index

Arguments

  • size_hint - Number of points to add (maybe 0, if unkown).
  • node_size - Size of the KD-tree node.

pub fn add_point(&mut self, id: usize, x: f64, y: f64)[src]

Add point to index

pub fn build_index(&mut self)[src]

Build index

pub fn range<F>(&self, minx: f64, miny: f64, maxx: f64, maxy: f64, visitor: F) where
    F: FnMut(usize), 
[src]

Finds all items within the given bounding box

Arguments

  • minx, miny, maxx, maxy - Bounding box
  • visitor - Result reader

pub fn within<F>(&self, qx: f64, qy: f64, r: f64, visitor: F) where
    F: FnMut(usize), 
[src]

Finds all items within a given radius from the query point

Arguments

  • qx, qy - Query point
  • r - Radius
  • visitor - Result reader

Auto Trait Implementations

impl RefUnwindSafe for KDBush

impl Send for KDBush

impl Sync for KDBush

impl Unpin for KDBush

impl UnwindSafe for KDBush

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, 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.