Crate spatio

Crate spatio 

Source
Expand description

Embedded spatio-temporal database with 2D/3D indexing, persistence, and TTL support.

use spatio::{Point, Spatio};

let db = Spatio::memory()?;
db.insert("key", b"value", None)?;

let point = Point::new(-74.0060, 40.7128);
db.insert_point("cities", &point, b"NYC", None)?;
let nearby = db.query_within_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 compute::BBoxQuery;
pub use compute::CylinderQuery;
pub use compute::DistanceMetric;
pub use compute::bounding_box;
pub use compute::convex_hull;
pub use compute::distance_between;
pub use compute::knn;
pub use config::Config;
pub use config::DbStats;
pub use config::SetOptions;
pub use config::SyncMode;
pub use config::SyncPolicy;
pub use config::HistoryEntry;
pub use config::HistoryEventKind;
pub use db::AtomicBatch;
pub use db::Namespace;
pub use db::NamespaceManager;
pub use storage::MemoryBackend;
pub use storage::StorageBackend;
pub use storage::StorageOp;
pub use storage::StorageStats;
pub use storage::AOFBackend;
pub use storage::AOFConfig;
pub use storage::AOFFile;

Modules§

builder
Database builder for flexible configuration
compute
Compute layer for query processing and algorithms.
config
Configuration and database settings for Spatio
db
Core database implementation for Spatio.
error
Error types and result aliases for Spatio operations.
ffi
C-compatible FFI for the Spatio database.
prelude
Common imports
storage
Storage backend abstraction for Spatio

Structs§

BoundingBox2D
A 2D axis-aligned bounding box.
BoundingBox3D
A 3D axis-aligned bounding box.
Point
A single point in 2D space.
Point3d
A 3D geographic point with x, y (longitude/latitude) and z (altitude/elevation).
Polygon
A bounded two-dimensional area.
Polygon3D
PolygonDynamic
PolygonDynamic3D
Rect
An axis-aligned bounded 2D rectangle whose area is defined by minimum and maximum Coords.
TemporalBoundingBox2D
A 2D bounding box with an associated timestamp.
TemporalBoundingBox3D
A 3D bounding box with an associated timestamp.
TemporalPoint
A geographic point with an associated timestamp.
TemporalPoint3D
A geographic point with an associated altitude and timestamp.

Constants§

VERSION

Type Aliases§

Spatio
Trajectory
Trajectory3D