SAURON GitHub

Geospatial hazard pipeline

Scattered public hazard feeds, turned into one auditable incident record.

SAURON ingests National Weather Service alerts, USGS earthquakes, Open-Meteo conditions, San Francisco collision records and news headlines. It normalizes everything into one validated schema, puts each event on the map only as precisely as the evidence allows, merges reports of the same incident and tracks every incident from open to cleared. For any incident you can see which sources reported it, when, how its location was determined and why it was cleared.

A personal engineering project. It runs locally with Docker Compose and has not been deployed for customers or run at scale. This site is a static showcase: the pipeline itself is not running here.

  • 5public sources, each with health reporting
  • 4%wrong headline placements on a held-out set (was 49%)
  • 0messages reprocessed after a restart on a real Kafka broker
  • 785/smessages processed, p95 9.5 ms (one laptop)
  • 175offline tests, plus a real-broker integration test

Interactive demo

This is the real processor's output for the source responses bundled with the project, captured from the live feeds on 2026-10-15 and pinned to 17:00 UTC. It is the same data python -m src --demo serves, exported as a static snapshot by python -m tools.build_site. Click a shape, point or row to see its evidence, location basis and history.

Time (UTC)StatusSeverityType TitleLocationLocation basisVerification

News items in the demo are a fictional sample in the real Google News RSS format (test fixtures), so their links and outlets are not shown. Everything else is real public data as published that day.

The real dashboard during a live run

SAURON dashboard map tab: NWS warning polygons across the US drawn on a USGS topographic basemap, with a High Wind Watch selected in the detail panel
Map tab: 126 active NWS warning areas from a live Docker Compose run, drawn without WebGL.
SAURON dashboard incidents tab: a sortable table of active weather incidents with severity, type, title and location, and a detail panel
Incidents tab: filters, a sortable table and the detail panel with times, region and affected area.

What it does

SourceBecomesReliability
NWS active alerts
one nationwide request
Weather incidents with the alert's own polygon or its forecast-zone polygons; updates linked through CAP references; cleared when the source expires or withdraws themofficial
USGS earthquakes ≥ M2.5Seismic events with magnitude, depth, PAGER alert and metadata; never treated as road incidentsofficial
Open-Meteo at configured pointsModel-estimated wind, fog, ice, snow, heavy rain and thunderstorm conditions, with unit-checked thresholdsmodel
DataSF traffic collisionsHistorical, point-located collision records (published 1-3 days late)official, delayed
Google News RSSUnverified road-incident reports, located only from places named in the headline; corroborated when two outlets report the same crashmedia

Ingestion with health

Each feed polls on its own interval. Every poll ends as a success (zero items is normal) or a named failure: timeout, connection, http_<code>, parse, publish, internal. NWS uses ETag conditional requests; 429 and 5xx retry with backoff that honours Retry-After. Quiet sources are told apart from broken ones.

One validated schema

Every source maps to schema version 2. Anything that fails validation is dead-lettered with its Kafka offset, never stored. Units are requested explicitly and checked (km/h, mm, °C). Provenance records which fields came from the source, which were inferred and how.

Location with stated confidence

Source point, source area, geocoded high or medium, ambiguous, or unresolved. Headlines are located only from places they name, through the US Census Gazetteer. The outlet's market can choose between same-named places but never supplies a location. Ambiguous names stay off the map.

Real geometry

NWS zone polygons are fetched once, simplified with Douglas-Peucker to about 50 m and cached. "Which warnings covered this point" is exact point-in-polygon with hole support, not a centroid comparison. Point events get an H3 cell (resolution 7) for correlation.

Deterministic correlation

Same event id, then CAP references for NWS updates and alternate ids for USGS, then Open-Meteo series, then roadway reports in the same or neighbouring H3 cell within ±180 minutes, rejected when they name different roads or opposite directions. Two outlets on one crash make it corroborated.

Incident lifecycle

open → updated → cleared, with separate reasons: source expired, source withdrawn, not re-observed, observation window elapsed, reported reopened. None of them claims the hazard physically ended. A cleared incident reopens when new, unexpired evidence arrives.

Durable and replayable

Kafka keeps what the sources said, not SAURON's interpretation, so improved mappers can be replayed over old data. Offsets are committed only after storage, and writes are idempotent through content-hash versioning. Replaying into a fresh store gives an identical result.

Dashboard

Plotly Dash with incidents, map, source events, analytics and system health tabs. Filters for time, state, category, US state, severity and location quality. Leaflet map with markers, clusters or heatmap over USGS and OpenStreetMap basemaps; no WebGL needed. Light and dark themes, CSV export, per-incident reports.

Read-only JSON API

Incidents with filters, bounding box and keyset pagination; incident detail with every piece of evidence and its state history; NWS alerts covering a point during a time window; /healthz and /readyz with per-feed status.

Observability

Prometheus metrics for poll outcomes, response times, rejects and filter reasons, duplicates suppressed, geocoder outcomes, dead letters, consumer lag and publication-to-available latency. Alert rules never fire on zero events. A Grafana dashboard is provisioned automatically. Logs are JSON lines.

Security and privacy

Binds to loopback by default and refuses a public address without a password or API token. Credentials are compared in constant time; the container runs unprivileged. Event-level data only: person-level contact enrichment was removed, and follow-up headlines, the ones that name victims, are filtered out.

Evaluation tooling

Hand-labeled development and held-out headline sets, with code hashes recorded before the holdout was viewed. Scripts for geocoding evaluation, throughput benchmarking and migrating the original pipeline's output with verified backups.

How it works

One Python process (feed threads, processor, maintenance loop, dashboard and API) and a single-node Kafka broker. Prometheus and Grafana are optional observers.

  1. Public sourcesNWS · USGS · Open-Meteo · DataSF · news RSS
  2. Feed threadspoll, validate the response, dedupe, record health, back off on failure
  3. Kafka hazards.rawraw envelopes, acks=all, 14-day retention
  4. Processornormalize, validate, geocode, correlate, lifecycle; commit offsets after store
  5. SQLite (WAL)source events, incidents, history, feed status, dead letters
  6. Dashboard + APIDash UI, read-only JSON API, incident reports and CSV

Also: the US Census Gazetteer feeds the processor's geocoder; feeds and processor expose /metrics to Prometheus, which feeds Grafana.

Delivery guarantees

  • At-least-once delivery with idempotent writes. There is no claim of exactly-once.
  • A crash between storing and committing replays part of a batch; a version is only added when its content hash changes.
  • If SQLite fails, the batch rolls back, the consumer seeks back and retries. Nothing is committed.
  • A message that cannot be parsed or validated goes to dead_letters with its offset, so one bad message cannot block the partition.
  • Incident ids derive from the first source event and history uses source times, so replaying the same log reproduces the same store.

Technologies

AreaTechnologyUsed for
LanguagePython 3.12The whole pipeline: feeds, processor, store, dashboard, API, tools
StreamingApache Kafka 3.9.1 (KRaft, single node), kafka-python 2.2.15Durable raw log with consumer-group offsets; replay
StorageSQLite in WAL modeEvents, incidents, history, caches, feed status; indexed time, category and bounding-box queries
GeospatialH3 4.5.0; US Census Gazetteer 2025; own point-in-polygon and Douglas-Peucker; optional NominatimCorrelation cells, place-name geocoding, warning-area queries, polygon simplification
Ingestionrequests 2.32.4, feedparser 6.0.11, PyYAML 6.0.2HTTP polling with retries and ETags, RSS parsing, configuration
DashboardDash 3.1.1 (Flask), dash-bootstrap-components 2.0.3, Plotly 6.2.0, pandas 2.3.1Tabs, filters, tables, analytics charts, CSV export
MapsLeaflet 1.9.4, Leaflet.markercluster 1.5.3, Leaflet.heat 0.2.0; USGS The National Map and OpenStreetMap tilesPoints, clusters, heatmap and warning polygons without WebGL
Observabilityprometheus_client 0.22.1, Prometheus 2.53.0, Grafana 11.1.0Metrics, alert rules, provisioned dashboard
PackagingDocker (python:3.12-slim, non-root), Docker ComposeKafka, topic init, app, Prometheus and Grafana, all on 127.0.0.1
Testingpytest 9.1.1Fixture-based tests on real captured responses; real-broker integration test
This siteStatic HTML, CSS and JavaScript on VercelShowcase and demo snapshot; no server code

Removed, and why

Apache Spark

It copied hazards.raw byte for byte into another topic and kept its checkpoint in /tmp, so every restart re-forwarded the whole topic. Consuming the raw topic directly is the same input with one fewer copy.

Neo4j

It stored one node per event with no relationships, and every query was a full scan. SQLite with indexes fits an append-mostly, single-writer workload of a few thousand events a day.

Redis

It held deduplication and a geocoding cache without persistence. Deduplication now lives in the store; the zone-geometry and optional Nominatim caches are in SQLite and survive restarts.

What it does not do

  • It is not a live traffic feed. News is polled every 5 minutes and is usually published hours after an incident; it is a signal.
  • It does not guess locations. Most headlines cannot be located from their text: 35 of 58 held-out headlines with a known place stay unresolved rather than being placed wrongly.
  • It does not claim damage. A warning covering a location is not evidence that the location was damaged, and no clear reason claims a hazard physically ended.
  • It has no historical backfill. Only data collected while it runs is searchable.
  • It does not promise exactly-once delivery. It is at-least-once with idempotent writes.
  • It is not built for large scale. Single process, one broker partition and SQLite: thousands of events a day, not millions.
  • It collects no person-level data. Contact enrichment was removed; headlines naming victims are filtered.
  • It is not a multi-user product. No accounts, audit log or billing; access is a shared bearer token or basic auth, and TLS belongs in a reverse proxy.
  • It is not licensed for commercial use as configured. Open-Meteo's free tier and Google News headlines are non-commercial; a paid Open-Meteo key or disabling those feeds is required.
  • Locations have known coarseness. County-level points are county centroids (100+ km off in large counties); NWS zone polygons are simplified to about 50 m.
  • Some things are not measured yet. Weather false-positive rate against station observations, precision of cross-source news merging, and operation beyond about an hour of live runs.
  • It does not run on Vercel. The pipeline needs long-running threads, a Kafka broker and a writable database; this page is a static showcase.

Designed but not built: a property and storm-intelligence report (address plus date range, NWS warnings, storm reports, station observations and radar hail estimates, each kept as a separate evidence class). Read the design.

Measured results

Measured on 2026-10-15 on one Apple-silicon laptop. Method, commands and caveats are in docs/data-quality.md.

Headline geocoding, held-out set

78 hand-labeled headlines, labeled after the code was frozen; 58 have a known place.

OriginalCurrent
Wrong placements23 of 47 (49%)1 of 23 (4%)
Correct, of 581922
Left unresolved, of 581935

The gain is in not placing incidents wrongly; coverage stays limited by what headlines say.

Everything else

News classification
Incident vs follow-up vs other on the holdout: precision 0.947, recall 1.0
Weather rules
Of 1,343 historical wind "hazards", 8 (0.6%) qualify under corrected units; none of 136 "snow" hazards do
Replay
On a real broker, a restart reprocessed 0 messages and a full replay changed nothing
Throughput
785 messages/s first pass (p95 9.5 ms); 2,422/s on replay
Live run
11 minutes on Docker Compose: 17 of 17 polls succeeded, 178 events stored, 0 dead letters; new NWS alerts were queryable a median 67 s after publication (n=6)

Problems found in the original code and fixed

  • Silent failure. The NWS parser decoded JSON twice and swallowed the error: 0 of 525 live alerts were ever produced.
  • Unit errors. km/h gusts were compared with an m/s threshold and metres with a kilometre threshold, so 1,343 of 1,509 weather "hazards" were ordinary breezes and fog could never fire.
  • Replay duplication. A pass-through Spark job with a /tmp checkpoint and a consumer with no group re-processed the whole topic on every restart: 18,451 CSV rows for 4,753 hazards.
  • Geographic ambiguity. "Crash in Canton" could be in any of a dozen states; ambiguous names are now left unmapped.
  • Areas vs points. County-wide warnings keep their polygons instead of collapsing to a centroid.

Run it yourself

Offline demo

No network, broker or credentials. Opens on 127.0.0.1:8050.

python -m venv .venv
. .venv/bin/activate
pip install -r requirements-dev.txt
python -m src --demo

Live, with Docker

Dashboard :8050, Prometheus :9090, Grafana :3000, all on 127.0.0.1.

cp .env.example .env
docker compose up -d --build

Tests

Offline suite, then against a real broker.

pytest
docker compose up -d kafka kafka-init
SAURON_KAFKA_TEST=1 pytest tests/integration

API

EndpointReturns
GET /api/v1/incidentsIncidents filtered by state, category, type, time, bbox, location quality and text; keyset pagination
GET /api/v1/incidents/{id}One incident with GeoJSON geometry, every piece of evidence and its state history
GET /api/v1/alerts/atEvery stored NWS alert version whose polygon contains a point during a time window
GET /healthz, /readyzLiveness; store counts and per-feed health