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 operations;
19pub mod persist;
20pub mod predicates;
21pub mod rtree;
22pub mod spatial_join;
23pub mod validate;
24pub mod wkb;
25pub mod wkt;
26
27pub use geohash::{geohash_decode, geohash_encode, geohash_neighbors};
28pub use geohash_index::GeohashIndex;
29pub use h3::{
30    h3_encode, h3_encode_string, h3_is_valid, h3_neighbors, h3_parent, h3_resolution,
31    h3_to_boundary, h3_to_center,
32};
33pub use hybrid::{SpatialPreFilterResult, bitmap_contains, ids_to_bitmap, spatial_prefilter};
34pub use operations::{st_buffer, st_envelope, st_union};
35pub use persist::{
36    RTreeCheckpointError, SpatialIndexMeta, SpatialIndexType, deserialize_meta, meta_storage_key,
37    rtree_storage_key, serialize_meta,
38};
39pub use predicates::{
40    st_contains, st_disjoint, st_distance, st_dwithin, st_intersection, st_intersects, st_within,
41};
42pub use rtree::{RTree, RTreeEntry};
43pub use validate::{is_valid, validate_geometry};
44pub use wkb::{geometry_from_wkb, geometry_to_wkb};
45pub use wkt::{geometry_from_wkt, geometry_to_wkt};