Expand description
Geospatial query support for AllSource events
Enables spatial filtering of events based on coordinates stored in event metadata or payload. Supports:
- Bounding box queries: Find events within a rectangular region
- Radius queries: Find events within a distance of a point (haversine)
- Geospatial indexing: In-memory spatial index using grid cells for O(1) lookups
§Coordinate extraction
Coordinates are extracted from events by checking (in order):
metadata.location.lat/metadata.location.lngmetadata.lat/metadata.lngpayload.location.lat/payload.location.lngpayload.lat/payload.lngmetadata.latitude/metadata.longitudepayload.latitude/payload.longitude
§Limitations
- Grid-based spatial index (not R-tree) — adequate for moderate datasets
- Haversine assumes spherical Earth (max ~0.3% error vs ellipsoidal)
- Events without coordinates are silently excluded from spatial queries
Structs§
- Bounding
Box - Bounding box for rectangular queries
- Coordinate
- A geographic coordinate
- GeoEvent
Result - A geo-enriched event result
- GeoIndex
- In-memory geospatial index using grid cells
- GeoIndex
Stats - Geo index statistics
- GeoQuery
Request - Geospatial query request
- Radius
Query - Radius query parameters
Functions§
- execute_
geo_ query - Execute a geospatial query against events using the geo index
- extract_
coordinates - Extract coordinates from an event’s metadata or payload
- haversine_
distance - Haversine distance between two coordinates in kilometers