[−][src]Struct kdbush::KDBush
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 readernode_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]
F: FnMut(usize),
Finds all items within the given bounding box
Arguments
minx
,miny
,maxx
,maxy
- Bounding boxvisitor
- Result reader
pub fn within<F>(&self, qx: f64, qy: f64, r: f64, visitor: F) where
F: FnMut(usize),
[src]
F: FnMut(usize),
Finds all items within a given radius from the query point
Arguments
qx
,qy
- Query pointr
- Radiusvisitor
- 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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,