normalizers/nws: add NWS alerts normalizer and canonical alert mapping

- Introduce AlertsNormalizer to convert Raw NWS Alerts (SchemaRawNWSAlertsV1)
  into canonical WeatherAlert runs (SchemaWeatherAlertV1)
- Add minimal NWS alerts response/types to support GeoJSON FeatureCollection parsing
- Map NWS alert properties (event, headline, severity, timing, area, references)
  into model.WeatherAlert with best-effort timestamp handling
- Establish clear AsOf / EffectiveAt policy for alert runs to support stable
  deduplication and snapshot semantics
- Register the new alerts normalizer alongside existing NWS observation and
  forecast normalizers
This commit is contained in:
2026-01-16 21:40:20 -06:00
parent 2eb2d4b90f
commit 00e811f8f7
7 changed files with 536 additions and 27 deletions

View File

@@ -48,22 +48,30 @@ sources:
# url: "https://api.weather.gov/gridpoints/LSX/90,74/forecast"
# user_agent: "HomeOps (eric@maximumdirect.net)"
- name: NWSHourlyForecastSTL
kind: forecast
driver: nws_forecast
every: 1m
params:
url: "https://api.weather.gov/gridpoints/LSX/90,74/forecast/hourly"
user_agent: "HomeOps (eric@maximumdirect.net)"
# - name: NWSAlertsSTL
# kind: alert
# driver: nws_alerts
# - name: NWSHourlyForecastSTL
# kind: forecast
# driver: nws_forecast
# every: 1m
# params:
# url: "https://api.weather.gov/alerts?point=38.6239,-90.3571&limit=500"
# url: "https://api.weather.gov/gridpoints/LSX/90,74/forecast/hourly"
# user_agent: "HomeOps (eric@maximumdirect.net)"
- name: NWSAlertsSTL
kind: alert
driver: nws_alerts
every: 1m
params:
url: "https://api.weather.gov/alerts?point=38.6239,-90.3571&limit=500"
user_agent: "HomeOps (eric@maximumdirect.net)"
- name: NWSAlertsIowa
kind: alert
driver: nws_alerts
every: 1m
params:
url: "https://api.weather.gov/alerts/active/zone/IAZ048"
user_agent: "HomeOps (eric@maximumdirect.net)"
sinks:
- name: stdout
driver: stdout