quadtree_rs
Point/region Quadtree with support for overlapping regions.
For documentation, see docs.rs/quadtree_rs.
Quick Start
use ;
// Instantiate a new quadtree which associates String values with u64
// coordinates.
let mut qt = new;
// A depth of four means a square with width (and height) 2^4.
assert_eq!;
// Associate the value "foo" with a rectangle of size 2x1, anchored at (0, 0).
let region_a = default
.anchor
.dimensions
.build.unwrap;
qt.insert;
// Query over a region of size 2x2, anchored at (1, 0).
let region_b = default
.anchor
.dimensions
.build.unwrap;
let mut query = qt.query;
// The query region (region_b) intersects the region "foo" is associated with
// (region_a), so the query iterator returns "foo" by reference.
assert_eq!;
Questions?
Please file an issue on GitHub.
Authors
See Cargo.toml
.
Contributing
See CONTRIBUTING.md
and NOTES.md
License
This project is licensed under the Apache 2.0 license.
Disclaimer
This is not an official Google product.
TODO
- Pretty-print quadtree function which plots a density map
- Benchmark tests