spatio_types/
lib.rs

1//! # spatio-types
2//!
3//! Core spatial and temporal data types for the Spatio database.
4//!
5//! This crate provides fundamental types for working with spatio-temporal data:
6//!
7//! - **Point types**: `TemporalPoint`, `TemporalPoint3D`, `Point3d`
8//! - **Polygon types**: `Polygon3D`, `PolygonDynamic`, `PolygonDynamic3D`
9//! - **Trajectory types**: `Trajectory`, `Trajectory3D`
10//! - **Bounding box types**: `BoundingBox2D`, `BoundingBox3D`, `TemporalBoundingBox2D`, `TemporalBoundingBox3D`
11//!
12//! All types are serializable with Serde and built on top of the `geo` crate's
13//! geometric primitives.
14//!
15//! ## Examples
16//!
17//! ```rust
18//! use spatio_types::point::TemporalPoint;
19//! use spatio_types::bbox::BoundingBox2D;
20//! use geo::Point;
21//! use std::time::SystemTime;
22//!
23//! // Create a temporal point
24//! let point = Point::new(-74.0060, 40.7128); // NYC coordinates
25//! let temporal_point = TemporalPoint::new(point, SystemTime::now());
26//!
27//! // Create a bounding box
28//! let manhattan = BoundingBox2D::new(-74.0479, 40.6829, -73.9067, 40.8820);
29//! assert!(manhattan.contains_point(&point));
30//! ```
31
32pub mod bbox;
33pub mod point;
34pub mod polygon;
35pub mod trajectory;