#spatial-index #kdtree #spatial #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

#2240 in Algorithms

Download history 100/week @ 2024-07-22 107/week @ 2024-07-29 35/week @ 2024-08-05 96/week @ 2024-08-12 152/week @ 2024-08-19 193/week @ 2024-08-26 124/week @ 2024-09-02 160/week @ 2024-09-09 206/week @ 2024-09-16 251/week @ 2024-09-23 284/week @ 2024-09-30 300/week @ 2024-10-07 262/week @ 2024-10-14 294/week @ 2024-10-21 183/week @ 2024-10-28 310/week @ 2024-11-04

1,065 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