A Rust implementation of k-dimensional trees for fast geospatial indexing and nearest neighbor lookups.
kdtree-rs is a Rust library that implements k-dimensional trees, a space-partitioning data structure for organizing points in a k-dimensional space. It enables fast nearest neighbor searches and spatial indexing, making it ideal for applications that need to quickly find nearby points in multi-dimensional datasets.
Rust developers working with spatial data, geographic applications, machine learning, or any domain requiring efficient proximity queries in multi-dimensional spaces.
Developers choose kdtree-rs for its pure Rust implementation, performance-optimized algorithms, clean API, and focus on geospatial use cases where fast nearest neighbor lookups are critical.
K-dimensional tree in Rust for fast geospatial indexing and lookup
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Benchmarks in the README show nearest neighbor searches completing in 1,237 ns for 1k 3D points, indicating high efficiency for spatial queries.
Specifically optimized for 2D and 3D coordinates, making it ideal for geographic applications as highlighted in the features section.
Supports custom distance implementations beyond the built-in squared Euclidean, allowing flexibility for various use cases, as demonstrated in the usage example.
Uses a balanced tree structure to minimize memory overhead while maintaining fast performance, aligning with the library's focus on efficiency.
Only squared Euclidean distance is provided out-of-the-box; other common metrics require custom implementation, which can add complexity.
The library lacks built-in serialization features, meaning developers must manually handle saving and loading tree structures for persistence.
The tree is initialized with a fixed number of dimensions, which can be inflexible for datasets with varying dimensionality or dynamic changes.