#spatial-index #spatial #kdtree #geometry #search-algorithms

kdbush

A very fast static spatial index for 2D points based on a flat KD-tree

2 unstable releases

0.2.0 Apr 21, 2020
0.1.0 Jun 17, 2017

#1976 in Algorithms

Download history 134/week @ 2024-03-13 54/week @ 2024-03-20 96/week @ 2024-03-27 140/week @ 2024-04-03 123/week @ 2024-04-10 135/week @ 2024-04-17 156/week @ 2024-04-24 63/week @ 2024-05-01 109/week @ 2024-05-08 142/week @ 2024-05-15 164/week @ 2024-05-22 157/week @ 2024-05-29 119/week @ 2024-06-05 201/week @ 2024-06-12 122/week @ 2024-06-19 88/week @ 2024-06-26

550 downloads per month
Used in 5 crates

ISC license

15KB
317 lines

kdbush

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

No runtime deps