kdbush 0.2.0

A very fast static spatial index for 2D points based on a flat KD-tree.
Documentation
  • Coverage
  • 33.33%
    2 out of 6 items documented1 out of 1 items with examples
  • Size
  • Source code size: 14.85 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.54 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Homepage
  • pka/rust-kdbush
    12 3 2
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • pka

kdbush

crates.io Documentation

A Rust port of kdbush, a very fast static spatial index for 2D points based on a flat KD-tree.

Introduction: A dive into spatial search algorithms

Comparison of point and box spatial index libraries.

Usage

let points = vec![(54.0, 1.0), (97.0, 21.0), (65.0, 35.0)];
let index = KDBush::create(points, kdbush::DEFAULT_NODE_SIZE); // make an index
index.range(20.0, 30.0, 50.0, 70.0, |id| print!("{} ", id));   // bbox search - minX, minY, maxX, maxY
index.within(50.0, 50.0, 20.0, |id| print!("{} ", id));        // radius search - x, y, radius