Expand description
Spatial and temporal indexing for efficient queries.
This module provides data structures for fast spatial and temporal lookups of events and other entities.
§Overview
SpatialIndex- R-tree based spatial indexing for geographic queriesTemporalIndex- B-tree based temporal indexing for time-range queriesSpatiotemporalIndex- Combined space-time indexing
§Example
use spatial_narrative::index::{SpatialIndex, TemporalIndex, SpatiotemporalIndex};
use spatial_narrative::core::{Location, Timestamp, GeoBounds, TimeRange};
// Create a spatiotemporal index
let mut index = SpatiotemporalIndex::new();
index.insert("Event 1",
&Location::new(40.7128, -74.0060),
&Timestamp::now());
// Query by location
let bounds = GeoBounds::new(39.0, -75.0, 42.0, -73.0);
let spatial_results = index.query_spatial(&bounds);
// Query by time
let range = TimeRange::year(2024);
let temporal_results = index.query_temporal(&range);
// Query by both
let combined_results = index.query(&bounds, &range);Structs§
- Grid
Spec - Specification for generating a heatmap grid.
- Heatmap
- Result of a heatmap computation.
- Indexed
Location - A wrapper that makes Location compatible with R-tree indexing.
- Sliding
Window Iter - Iterator over sliding time windows.
- Spatial
Index - Spatial index for efficient geographic queries.
- Spatiotemporal
Index - Combined spatiotemporal index for efficient space-time queries.
- Temporal
Index - Temporal index for efficient time-based queries.