Struct kdbush::KDBush
[−]
[src]
pub struct KDBush { /* fields omitted */ }
A very fast static spatial index for 2D points based on a flat KD-tree
Methods
impl KDBush
[src]
fn create<R: PointReader>(points: R, node_size: u8) -> KDBush
Creates an index from the given points
Arguments
points
- Input points readernode_size
- Size of the KD-tree node, 64 by default. Higher means faster indexing but slower search, and vise versa
fn range<F>(&self, minx: f64, miny: f64, maxx: f64, maxy: f64, visitor: F) where
F: FnMut(usize),
F: FnMut(usize),
Finds all items within the given bounding box
Arguments
minx
,miny
,maxx
,maxy
- Bounding boxvisitor
- Result reader
fn within<F>(&self, qx: f64, qy: f64, r: f64, visitor: F) where
F: FnMut(usize),
F: FnMut(usize),
Finds all items within a given radius from the query point
Arguments
qx
,qy
- Query pointr
- Radiusvisitor
- Result reader