pub struct SpatiotemporalIndex<T> { /* private fields */ }Expand description
Combined spatiotemporal index for efficient space-time queries.
This index maintains both a spatial R-tree and a temporal B-tree, enabling queries that filter by both dimensions efficiently.
Implementations§
Source§impl<T: Clone> SpatiotemporalIndex<T>
impl<T: Clone> SpatiotemporalIndex<T>
Sourcepub fn from_iter<I, L, Ts>(iter: I, location_fn: L, timestamp_fn: Ts) -> Self
pub fn from_iter<I, L, Ts>(iter: I, location_fn: L, timestamp_fn: Ts) -> Self
Create an index from items with location and timestamp extractors.
Sourcepub fn insert(&mut self, item: T, location: &Location, timestamp: &Timestamp)
pub fn insert(&mut self, item: T, location: &Location, timestamp: &Timestamp)
Insert an item with its location and timestamp.
Sourcepub fn query(&self, bounds: &GeoBounds, range: &TimeRange) -> Vec<&T>
pub fn query(&self, bounds: &GeoBounds, range: &TimeRange) -> Vec<&T>
Query items within both spatial bounds and time range.
Sourcepub fn query_spatial(&self, bounds: &GeoBounds) -> Vec<&T>
pub fn query_spatial(&self, bounds: &GeoBounds) -> Vec<&T>
Query items within spatial bounds only.
Sourcepub fn query_temporal(&self, range: &TimeRange) -> Vec<&T>
pub fn query_temporal(&self, range: &TimeRange) -> Vec<&T>
Query items within time range only.
Sourcepub fn nearest_in_range(
&self,
lat: f64,
lon: f64,
k: usize,
range: &TimeRange,
) -> Vec<&T>
pub fn nearest_in_range( &self, lat: f64, lon: f64, k: usize, range: &TimeRange, ) -> Vec<&T>
Find k nearest items to a point within a time range.
Sourcepub fn time_range(&self) -> Option<TimeRange>
pub fn time_range(&self) -> Option<TimeRange>
Get the time range of all indexed items.
Trait Implementations§
Source§impl<T: Debug> Debug for SpatiotemporalIndex<T>
impl<T: Debug> Debug for SpatiotemporalIndex<T>
Auto Trait Implementations§
impl<T> Freeze for SpatiotemporalIndex<T>
impl<T> RefUnwindSafe for SpatiotemporalIndex<T>where
T: RefUnwindSafe,
impl<T> Send for SpatiotemporalIndex<T>where
T: Send,
impl<T> Sync for SpatiotemporalIndex<T>where
T: Sync,
impl<T> Unpin for SpatiotemporalIndex<T>where
T: Unpin,
impl<T> UnwindSafe for SpatiotemporalIndex<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more