Skip to main content

nodedb_spatial/
lib.rs

1// SPDX-License-Identifier: Apache-2.0
2
3//! Spatial engine primitives shared by Origin, Lite, and WASM: R*-tree with
4//! bulk load and nearest-neighbor / range queries, geohash and H3 hex
5//! indexes, OGC predicates (ST_Contains, ST_Intersects, ST_Within,
6//! ST_DWithin, ST_Distance, etc.), WKB / WKT / GeoJSON interchange, and
7//! hybrid spatial-vector composition.
8//!
9//! Spatial collections are picked per-collection via `WITH (engine='spatial')`
10//! and use the columnar storage core; this crate provides the index
11//! structures and predicate evaluators only.
12
13pub mod geo_meta;
14pub mod geohash;
15pub mod geohash_index;
16pub mod h3;
17pub mod hybrid;
18pub mod measures;
19pub mod operations;
20pub mod persist;
21pub mod predicates;
22pub mod rtree;
23pub mod spatial_join;
24#[cfg(test)]
25mod test_support;
26pub mod validate;
27pub mod wkb;
28pub mod wkt;
29
30pub use geohash::{geohash_decode, geohash_encode, geohash_neighbors};
31pub use geohash_index::GeohashIndex;
32pub use h3::{
33    h3_encode, h3_encode_string, h3_is_valid, h3_neighbors, h3_parent, h3_resolution,
34    h3_to_boundary, h3_to_center,
35};
36pub use hybrid::{SpatialPreFilterResult, bitmap_contains, ids_to_bitmap, spatial_prefilter};
37pub use measures::{st_area, st_centroid};
38pub use operations::{st_buffer, st_envelope, st_union};
39pub use persist::{
40    RTreeCheckpointError, SpatialIndexMeta, SpatialIndexType, deserialize_meta, meta_storage_key,
41    rtree_storage_key, serialize_meta,
42};
43pub use predicates::{
44    st_contains, st_disjoint, st_distance, st_dwithin, st_intersection, st_intersects, st_within,
45};
46pub use rtree::{RTree, RTreeEntry};
47pub use validate::{is_valid, validate_geometry};
48pub use wkb::{geometry_from_wkb, geometry_to_wkb};
49pub use wkt::{geometry_from_wkt, geometry_to_wkt};