fix(nws): replace centroid filter with polygon intersection

- Add shapely dependency for geometry intersection
- Replace _point_in_region with _geometry_intersects_region
- Uses Shapely shape() and box() for proper GeoJSON handling
- Avoids false negatives on large alert polygons

Also adds antimeridian-crossing bbox rejection to RegionConfig validator.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Matt Johnson 2026-05-16 19:05:05 +00:00
commit a157f39fe0
4 changed files with 660 additions and 513 deletions

File diff suppressed because it is too large Load diff

View file

@ -22,6 +22,8 @@ class RegionConfig(BaseModel):
)
if self.east == self.west:
raise ValueError("east and west cannot be equal (zero-width bbox)")
if self.east < self.west:
raise ValueError("antimeridian-crossing bboxes not supported")
return self