Skip to content

feat(radar): rain radar tab with FMI observed + forecast overlay - #982

Merged
eetu merged 1 commit into
mainfrom
eetu/feat/rain-radar-forecast
Jun 23, 2026
Merged

eetu merged 1 commit into
mainfrom
eetu/feat/rain-radar-forecast

Conversation

@eetu

@eetu eetu commented Jun 23, 2026

Copy link
Copy Markdown
Owner

New Sade tab: a Leaflet map centred on the saved location with pinch-zoom/pan, an animated timeline, and a recenter button.

Backend (radar module)

  • GET /api/radar/frames — last-hour observed radar frames, derived from FMI WMS GetCapabilities (5-min steps).
  • GET /api/radar/wms — transparent proxy for FMI WMS GetMap tiles (single fixed upstream, streams bytes).
  • GET /api/radar/forecast — FMI HARMONIE precipitation forecast: fetches the EPSG:4326 GRIB2 grid, decodes it with the grib crate (default-features = false, no native C deps), reads grid geometry straight from the GDS (no PROJ), orients north-up, block-max downsamples, converts metres→mm, returns a compact JSON grid. Retries transient FMI connection drops; cached 30 min.

Frontend (RainMap, lazy-loaded)

  • Observed WMS frames + forecast heat overlays (canvas colour ramp) merged into one timeline: play/pause, frame slider, a "now" divider, long-press-swipe scrub, relative-time labels (−30 min → nyt → +5 h), and a precipitation legend.
  • Pinch-zoom + pan native; CARTO base tiles swap with the light/dark theme.

Notes

  • FMI WMS/WFS need no API key. New settings FMI_WMS_BASE_URL / FMI_DOWNLOAD_BASE_URL default to the public endpoints.
  • Forecast covers southern Finland (~500×380 km) centred on the saved location; whole-Finland would need tiling (single lat/lon overlay misregisters over a tall span).
  • Forecast magnitudes cross-validated against FMI's own WFS point forecast.

Test plan

  • cargo test — 20 unit + 18 integration pass (incl. GRIB orientation/resampling)
  • yarn validate (typecheck + lint + format) clean; yarn build succeeds
  • Endpoints verified live against FMI (frames, WMS tile, forecast grid)

New "Sade" tab: a Leaflet map centred on the saved location with
pinch-zoom/pan, an animated timeline, and a recenter button.

Backend (radar module):
- GET /api/radar/frames — last-hour observed radar frames from FMI WMS
  capabilities (5-min steps).
- GET /api/radar/wms — transparent proxy for FMI WMS GetMap tiles.
- GET /api/radar/forecast — FMI HARMONIE precip forecast: fetch the
  EPSG:4326 GRIB2 grid, decode with the `grib` crate (no native deps),
  read grid geometry from the GDS, orient north-up, block-max downsample,
  convert metres→mm, return a compact JSON grid. Retries transient FMI
  drops; cached.

Frontend (RainMap, lazy-loaded):
- Observed WMS frames + forecast heat overlays merged into one timeline
  with a "now" divider, play/pause, frame slider, long-press swipe scrub,
  relative-time labels, and a precipitation legend.

FMI WMS/WFS need no API key; new FMI_WMS_BASE_URL / FMI_DOWNLOAD_BASE_URL
settings default to the public endpoints.
@eetu
eetu merged commit 4a3aa75 into main Jun 23, 2026
3 checks passed
@eetu
eetu deleted the eetu/feat/rain-radar-forecast branch June 23, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant