Expand description
Embedded spatio-temporal database with 2D/3D indexing and persistence.
§Features
- Spatial indexing: 2D/3D points, polygons, bounding boxes with R*-tree spatial indexing
- Persistence: Append-only file (AOF) with configurable sync policies
- Atomic batches: Group multiple operations atomically
- Temporal queries: Filter by creation time (with
time-indexfeature)
§Example
use spatio::{Point3d, Spatio};
let db = Spatio::memory()?;
// Spatial example
let point = Point3d::new(-74.0060, 40.7128, 0.0);
db.upsert("cities", "nyc", point.clone(), serde_json::json!({"name": "NYC"}), None)?;
let nearby = db.query_radius("cities", &point, 1000.0, 10)?;
Re-exports§
pub use builder::DBBuilder;pub use db::DB;pub use error::Result;pub use error::SpatioError;pub use config::Config;pub use config::HistoryEntry;pub use config::HistoryEventKind;pub use db::Namespace;pub use db::NamespaceManager;pub use compute::validation;
Modules§
- builder
- Database builder
- compute
- Query processing, spatial algorithms, validation, and GeoJSON conversion.
- config
- Configuration and database settings for Spatio
- db
- Core database implementation for Spatio.
- error
- Error types and result aliases for Spatio operations.
- prelude
- Common imports
Structs§
- Bounding
Box2D - A 2D axis-aligned bounding box.
- Bounding
Box3D - A 3D axis-aligned bounding box.
- DbStats
- Database statistics
- Point
- A geographic point with longitude/latitude coordinates.
- Point3d
- A 3D geographic point with x, y (longitude/latitude) and z (altitude/elevation).
- Polygon
- A polygon with exterior and optional interior rings.
- Polygon3D
- Polygon
Dynamic - Polygon
Dynamic3D - Rect
- An axis-aligned bounded 2D rectangle whose area is
defined by minimum and maximum
Coords. - SetOptions
- Options for setting values.
- Spatio
- Embedded spatio-temporal database.
- Temporal
Bounding Box2D - A 2D bounding box with an associated timestamp.
- Temporal
Bounding Box3D - A 3D bounding box with an associated timestamp.
- Temporal
Point - A geographic point with an associated timestamp.
- Temporal
Point3D - A geographic point with an associated altitude and timestamp.
Enums§
- Distance
Metric - Distance metric for spatial calculations. Distance metric for spatial calculations.
- Sync
Mode - File synchronization strategy (fsync vs fdatasync).
- Sync
Policy - Synchronization policy for persistence.