Add live water layer from BAFU hydrology data #6

Merged
clayschaad merged 1 commit from feature/hydrology-layer into main 2026-11-18 19:41:24 +00:00
Owner

Live water data from BAFU as a new layer on the combined map.

Changes

  • New project Schaad.OpenData.Hydrology (same pattern as the other datasets):
    • LindasHydroClient: one SPARQL query to lindas.admin.ch/query every 10 minutes for nine stations (Bodensee Romanshorn, Untersee Berlingen, Thur Halden/Andelfingen/Jonschwil, Murg Frauenfeld/Wängi, Aach Salmsach, Sitter St. Gallen); configurable via Hydrology:StationIds.
    • LINDAS only has the current value, so the server keeps readings as JSON per day (hydrology/thurgau/days/…, 60 days).
    • HydrodatenPlotClient: fills missing history (first start, gaps > 45 min) from the 7-day plot JSON of hydrodaten.admin.ch, at most hourly per station, 10-minute marks only; LINDAS values win. Undocumented endpoint: if it fails, only the backfill is skipped.
  • API: /api/hydrology/meta, /stations (current values, 24 h level change and discharge), /stations/{id}/history?tage=7.
  • Combined map: layer "Gewässer (live)" – river circles sized by discharge and coloured by BAFU danger level or water temperature, lake badges with level and 24 h change; station panel with values and 7-day chart; lake levels and highest danger level in the overview; water stations in "In dieser Gemeinde"; BAFU credit in the footer.
  • Wiring: solution, server and test references, appsettings.json, Dockerfile.
  • Docs: docs/datasets/gewaesser.md, overview diagram and table in docs/datasets.md, CLAUDE.md.

Testing

  • dotnet test: 100 passed (20 new: LINDAS parsing, plot parsing, snapshot merge, storage, refresher incl. backfill rules, analysis).
  • npm run typecheck and npm run build pass.
  • Checked in the browser against live data: all layers together without console errors, backfill gives 987 points per station (12.11.–18.11.), 24 h changes and trend arrows, station panel chart, municipality context.

🤖 Generated with Claude Code

Live water data from BAFU as a new layer on the combined map. ## Changes - **New project `Schaad.OpenData.Hydrology`** (same pattern as the other datasets): - `LindasHydroClient`: one SPARQL query to `lindas.admin.ch/query` every 10 minutes for nine stations (Bodensee Romanshorn, Untersee Berlingen, Thur Halden/Andelfingen/Jonschwil, Murg Frauenfeld/Wängi, Aach Salmsach, Sitter St. Gallen); configurable via `Hydrology:StationIds`. - LINDAS only has the current value, so the server keeps readings as JSON per day (`hydrology/thurgau/days/…`, 60 days). - `HydrodatenPlotClient`: fills missing history (first start, gaps > 45 min) from the 7-day plot JSON of hydrodaten.admin.ch, at most hourly per station, 10-minute marks only; LINDAS values win. Undocumented endpoint: if it fails, only the backfill is skipped. - **API:** `/api/hydrology/meta`, `/stations` (current values, 24 h level change and discharge), `/stations/{id}/history?tage=7`. - **Combined map:** layer "Gewässer (live)" – river circles sized by discharge and coloured by BAFU danger level or water temperature, lake badges with level and 24 h change; station panel with values and 7-day chart; lake levels and highest danger level in the overview; water stations in "In dieser Gemeinde"; BAFU credit in the footer. - **Wiring:** solution, server and test references, `appsettings.json`, Dockerfile. - **Docs:** `docs/datasets/gewaesser.md`, overview diagram and table in `docs/datasets.md`, CLAUDE.md. ## Testing - `dotnet test`: 100 passed (20 new: LINDAS parsing, plot parsing, snapshot merge, storage, refresher incl. backfill rules, analysis). - `npm run typecheck` and `npm run build` pass. - Checked in the browser against live data: all layers together without console errors, backfill gives 987 points per station (12.11.–18.11.), 24 h changes and trend arrows, station panel chart, municipality context. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
clayschaad added 1 commit 2026-11-18 19:40:55 +00:00
- New Schaad.OpenData.Hydrology project: LindasHydroClient fetches the
  current level, discharge, water temperature and danger level of nine
  BAFU stations around Thurgau from LINDAS every 10 minutes
- LINDAS has no history, so the server keeps readings per day (60 days)
  and fills gaps from the 7-day plot JSON of hydrodaten.admin.ch
- API: /api/hydrology/meta, /stations, /stations/{id}/history
- Combined map: "Gewässer (live)" layer with river circles (size by
  discharge, colour by danger level or water temperature), lake level
  badges, station panel with 7-day chart, overview and municipality
  context entries
- Docs: docs/datasets/gewaesser.md, overview in docs/datasets.md,
  CLAUDE.md; Docker and appsettings wiring

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
clayschaad merged commit 58e4079ced into main 2026-11-18 19:41:24 +00:00
clayschaad deleted branch feature/hydrology-layer 2026-11-18 19:41:24 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: clayschaad/OpenDataVisualizer#6
No description provided.