Skip to main content

Module index

Module index 

Source
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

§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§

GridSpec
Specification for generating a heatmap grid.
Heatmap
Result of a heatmap computation.
IndexedLocation
A wrapper that makes Location compatible with R-tree indexing.
SlidingWindowIter
Iterator over sliding time windows.
SpatialIndex
Spatial index for efficient geographic queries.
SpatiotemporalIndex
Combined spatiotemporal index for efficient space-time queries.
TemporalIndex
Temporal index for efficient time-based queries.