rstar/
lib.rs

1//! An n-dimensional [r*-tree](https://en.wikipedia.org/wiki/R*-tree) implementation for use as a spatial index.
2//!
3//! This crate implements a flexible, n-dimensional r-tree implementation with
4//! the r* (r star) insertion strategy.
5//!
6//! # R-Tree
7//! An r-tree is a data structure containing _spatial data_, optimized for
8//! nearest neighbor search.
9//! _Spatial data_ refers to an object that has the notion of a position and extent:
10//! for example points, lines and rectangles in any dimension.
11//!
12//!
13//! # Further documentation
14//! The crate's main data structure and documentation is the [RTree] struct.
15//!
16//! ## Primitives
17//! The pre-defined primitives like lines and rectangles contained in
18//! the [primitives module](crate::primitives) may be of interest for a quick start.
19//! ## `Geo`
20//! For use with the wider Georust ecosystem, the primitives in the [`geo`](https://docs.rs/geo/latest/geo/#types) crate
21//! can also be used.
22//!
23//! # (De)Serialization
24//! Enable the `serde` feature for [serde](https://crates.io/crates/serde) support.
25//!
26//! # Mint compatibility with other crates
27//! Enable the `mint` feature for
28//! [`mint`](https://crates.io/crates/mint) support. See the
29//! documentation on the [mint] module for an expample of an
30//! integration with the
31//! [`nalgebra`](https://crates.io/crates/nalgebra) crate.
32#![deny(missing_docs)]
33#![forbid(unsafe_code)]
34#![cfg_attr(not(test), no_std)]
35
36extern crate alloc;
37
38mod aabb;
39mod algorithm;
40mod envelope;
41mod node;
42mod object;
43mod params;
44mod point;
45pub mod primitives;
46mod rtree;
47
48#[cfg(feature = "mint")]
49pub mod mint;
50
51#[cfg(test)]
52mod test_utilities;
53
54pub use crate::aabb::AABB;
55pub use crate::algorithm::rstar::RStarInsertionStrategy;
56pub use crate::algorithm::selection_functions::SelectionFunction;
57pub use crate::envelope::Envelope;
58pub use crate::node::{ParentNode, RTreeNode};
59pub use crate::object::{PointDistance, RTreeObject};
60pub use crate::params::{DefaultParams, InsertionStrategy, RTreeParams};
61pub use crate::point::{Point, RTreeNum};
62pub use crate::rtree::RTree;
63
64pub use crate::algorithm::iterators;