Storm-based polygon matching for NWS warnings #71
Labels
No labels
area:ai
area:ci-cd
area:notifications
area:observability
area:public-pages
backlog
bug
duplicate
enhancement
help wanted
invalid
question
type:decision
type:feature
type:infra
type:maintenance
type:security
v1.0.1
v1.1.0
v1.2.0
v1.3.0
v2.0.0
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/WeatherBot#71
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
NWS warnings carry polygon geometry; WeatherBot matches on zones (
affectedZones), which over-alert relative to the actual warned polygon — a hilltop location gets the county's flash-flood warning. The point-in-polygon machinery already exists inspc.py. Use alert geometry when present (fall back to zones), per-location opt-in. Probably missed because zone matching was the natural MVP and SPC polygon code came later. Effort M, value High — directly reduces false alarms, the main quality lever for an alerting tool.Filed from the 2026-07-17 codebase audit (
docs/.internal/report-2026-07-17.md), finding I-01.Closing as already implemented. The polygon-matching this issue asks for already exists and is active in the alert path — the audit pointed at the SPC
point_in_geometryhelper and missed that the NWS-alert path has its own equivalent.In
app/services/alert_identity.py:point_in_alert_geometry(location, alert)(lines 53-61) does point-in-polygon against the alert'sPolygon/MultiPolygongeometry, returningTruewhen the alert carries no polygon.location_matches_alert(location, alert)(lines 64-69) requires a zone/county-zone intersection andpoint_in_alert_geometry— i.e. it already "uses the alert geometry when present, falls back to zones" when NWS supplies no polygon.NWSAlert.geometryis parsed innws.py(~line 340), and the CAP ATOM fallback path sets empty geometry so it degrades to zone-only.So a location inside a warned zone but outside the storm-based warning polygon is already not alerted — the exact over-alarm this issue describes is already avoided. The one thing not built is making it a per-location toggle, but since polygon precision is the correct default for storm-based warnings (the polygon is the threat area) and mandatory precision matches current behavior, we've decided (2026-07-19) not to add an opt-out toggle for now. If a "never-miss / alert me for my whole county" mode is wanted later, it can be filed fresh with that framing.
No milestone impact beyond removing this from v1.5.0 scope.