TerraGuard

Google Flood Forecasting

Integration with Google's Flood Forecasting API to ingest forward-looking flood predictions, gated by a severity filter and a GeoPop population check before they enter the event pipeline.

Overview

Google Flood Forecasting is TerraGuard's prediction data source. Unlike GDACS, USGS, and NHC — which report events that have already happened or are happening now — Google Flood provides forward-looking riverine and flash-flood forecasts.

Events ingested from this source are flagged with is_prediction = true so the frontend and notification logic can present them as forecasts rather than confirmed events.

The adapter lives in the Event Processor (tg-event-processor) at internal/adapter/googleflood/ and polls Google's API on a configurable interval. It is disabled by default (GOOGLE_FLOOD_ENABLED=false) and enabled per-deployment.

What Google Flood Provides

The adapter consumes three kinds of flood status, each independently toggleable:

Prediction typeConfig toggleDescription
Gauge forecastGOOGLE_FLOOD_INCLUDE_GAUGERiver-gauge level forecasts with a severity band
Flash floodGOOGLE_FLOOD_INCLUDE_FLASHShort-fuse flash-flood likelihood for an area
Significant eventGOOGLE_FLOOD_INCLUDE_SIGNIFICANTLarger-area flood events affecting many people

API

The adapter calls the Flood Forecasting REST API:

POST https://floodforecasting.googleapis.com/v1/floodStatus:searchLatestFloodStatusByArea
SettingEnv varDefault
Base URLGOOGLE_FLOOD_API_URLhttps://floodforecasting.googleapis.com
API keyGOOGLE_FLOOD_API_KEY— (required when enabled)
Poll intervalGOOGLE_FLOOD_POLL_INTERVAL5m
Country scopeGOOGLE_FLOOD_COUNTRY_CODESper-deployment list

Polygon geometry returned for a prediction is cached by polygon id so repeated polls of the same area don't refetch the shape.

Two-stage filtering

Flood predictions are noisy, so the adapter applies two gates before an event is allowed into the pipeline. This keeps low-impact forecasts out of the system entirely.

Loading diagram...

Stage 1 — Google-side severity. Gauge forecasts must meet a minimum severity (GOOGLE_FLOOD_MIN_GAUGE_SEVERITY); flash floods must be classified highly_likely; significant events must exceed a population estimate (GOOGLE_FLOOD_MIN_SIGNIFICANT_POP).

Stage 2 — GeoPop population gate. After resolving the area centroid, the adapter asks the GeoPop API how many people live within GOOGLE_FLOOD_GEOPOP_RADIUS_KM of that point. If fewer than GOOGLE_FLOOD_GEOPOP_MIN_POP, the prediction is dropped — a forecast over an unpopulated area is not actionable.

Configuration

VariableDescription
GOOGLE_FLOOD_ENABLEDMaster switch (default false)
GOOGLE_FLOOD_API_KEYFlood Forecasting API key
GOOGLE_FLOOD_API_URLAPI base URL
GOOGLE_FLOOD_POLL_INTERVALPoll cadence (default 5m)
GOOGLE_FLOOD_COUNTRY_CODESCountries to query
GOOGLE_FLOOD_MIN_GAUGE_SEVERITYStage-1 minimum gauge severity
GOOGLE_FLOOD_MIN_SIGNIFICANT_POPStage-1 minimum population for significant events
GOOGLE_FLOOD_GEOPOP_MIN_POPStage-2 minimum population in radius
GOOGLE_FLOOD_GEOPOP_RADIUS_KMStage-2 population radius
GOOGLE_FLOOD_INCLUDE_GAUGE / _FLASH / _SIGNIFICANTPer-type toggles

The Backend API mirrors a subset for its own scheduled syncing (GOOGLE_FLOOD_API_KEY, GOOGLE_FLOOD_API_BASE_URL, GOOGLE_FLOOD_POLL_ENABLED, GOOGLE_FLOOD_FULL_SYNC_CRON, GOOGLE_FLOOD_CRITICAL_POLL_CRON).

Google Flood is the only prediction source in TerraGuard today. Because its output is a forecast, every event it produces carries is_prediction = true end-to-end — through scoring, the API, and the frontend — so users always know they are looking at a prediction.

On this page