GEO-INFER-IOT
Instructions
Core Capabilities
- Ingestion:
IoTDataIngestion— dict/SensorMeasurement ingestion, H3 spatial indexing, MQTT (paho-mqtt thread bridge + aiomqtt async), Bayesian spatial inference via GEO-INFER-BAYES - Registry:
SensorRegistry— sensor/network registration (SensorMetadata,SensorNetworkRecord) with H3 spatial queries - Streaming:
StreamingAPI— FastAPI WebSocket/ws/sensor-streamwith async broadcasts;SensorAPI— REST for sensors/measurements/networks - Quality control:
QualityController— range validation, temporal consistency, outlier detection (IsolationForest over the retained window plus a running 3-sigma z-score check), spatial consistency - Bayesian inference:
BayesianSpatialInference(ingeo_infer_iot.core.inference) — Gaussian-process spatial posteriors over an H3 grid - Radiation monitoring:
RadiationMonitoringSystem— end-to-end radiation ingestion, anomaly detection, and spatial inference
Key Imports
from geo_infer_iot import (
IoTDataIngestion,
SensorRegistry,
QualityController,
IoTSystem,
RadiationMonitoringSystem,
)
from geo_infer_iot.core.inference import BayesianSpatialInference
Examples
from geo_infer_iot import SensorRegistry, IoTDataIngestion
registry = SensorRegistry()
ingestion = IoTDataIngestion(registry, {"mqtt": {"host": "localhost", "port": 1883}})
measurement = {
"sensor_id": "temp_001",
"variable": "temperature",
"value": 21.5,
"unit": "celsius",
"latitude": 47.6062,
"longitude": -122.3321,
}
import asyncio
asyncio.run(ingestion.ingest_measurement(measurement))
print(ingestion.get_measurement_statistics())
from geo_infer_iot import QualityController
checker = QualityController({
"variable_ranges": {"temperature": (-40.0, 60.0)},
"temporal_consistency": {"max_change_rate": 0.1},
})
result = checker.validate_measurement({
"sensor_id": "temp_001",
"variable": "temperature",
"value": 21.5,
"timestamp": "2026-01-01T00:00:00+00:00",
})
print(f"Passed: {result.passed}, score: {result.quality_score:.2f}, issues: {result.issues}")
Agent interfaces
Use uv run --frozen geo-infer catalog IOT to discover public source
APIs, then geo-infer describe before calling a selected target. Scripts use
geo_infer_api.agent_runtime.AgentSession; the optional stdio MCP server is
geo-infer-mcp. See requests, native objects and composition.
The adapter retains this module's dependencies and authorization requirements.
Guidelines
- MQTT handlers use real paho-mqtt (thread bridge) or aiomqtt (async); broker connection happens in
start_stream_processinginside a running event loop - geo_infer_space, geo_infer_bayes, scipy, scikit-learn, folium, matplotlib, paho-mqtt and aiomqtt are hard dependencies — they import unconditionally (no availability flags or degraded fallbacks) and fail loudly on a broken install
- Timestamps are timezone-aware UTC end to end (same contract as GEO-INFER-TIME
normalize_timestamp):QualityController.validate_measurement,IoTDataIngestiondict input,SensorMeasurementand theMeasurementmodels accept aware datetimes or ISO-8601 strings with an offset (Zincluded), normalize them to UTC, and raiseValueErroron naive or malformed input (TypeErrorfor non-string, non-datetime values); helper:geo_infer_iot.models.measurement.normalize_timestamp. A missing timestamp defaults to the current UTC time on ingestion and skips temporal checks in quality control - Quality-control config nests under documented keys (e.g.
temporal_consistency.max_change_rate); flat top-level keys such asmax_change_rateare not read - Test:
uv run python GEO-INFER-TEST/run_unified_tests.py --module IOT
Integrations
- DATA → Sensor data feeds into ETL pipelines
- TIME → Time-series analysis of sensor streams
- SPACE → Spatial indexing of sensor locations
- OPS → Monitoring sensor health and uptime (
PredictiveMaintenance) - COMMS → Alert broadcasting on sensor thresholds
Sensor, measurement, registry and network timestamps require explicit offsets
and normalize to UTC through GEO-INFER-TIME. Location updates validate before
changing state and support H3 resolution 0. Bounds queries use exact inclusive
WGS84 coordinate membership across mixed resolutions and the antimeridian.
Install geo-infer-iot[visualization] for IoTVisualization; its public export
is resolved lazily. Durations use monotonic clocks rather than wall time.