rs-kdbush

Crates.iors-kdbush
lib.rsrs-kdbush
version0.2.0
sourcesrc
created_at2023-04-19 07:26:13.85002
updated_at2023-04-19 07:26:13.85002
descriptionA very fast static spatial index for 2D points based on a flat KD-tree.
homepagehttps://github.com/iwindx/rust-kdbush
repositoryhttps://github.com/iwindx/rust-kdbush
max_upload_size
id843269
size16,512
(iwindx)

documentation

https://docs.rs/rs-kdbush/

README

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
Commit count: 12

cargo fmt