Crates.io | kdbush |
lib.rs | kdbush |
version | 0.2.0 |
source | src |
created_at | 2017-06-17 21:20:54.76425 |
updated_at | 2020-04-21 21:56:45.836785 |
description | A very fast static spatial index for 2D points based on a flat KD-tree. |
homepage | https://github.com/pka/rust-kdbush |
repository | https://github.com/pka/rust-kdbush |
max_upload_size | |
id | 19360 |
size | 15,232 |
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.
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