Skip to content

fix(brief): skip self-intersecting polygons in coverage checks (#11)#17

Merged
jayrav13 merged 1 commit into
mainfrom
fix/airmet-self-intersection
May 2, 2026
Merged

fix(brief): skip self-intersecting polygons in coverage checks (#11)#17
jayrav13 merged 1 commit into
mainfrom
fix/airmet-self-intersection

Conversation

@jayrav13

@jayrav13 jayrav13 commented May 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Rescue RGeo::Error::InvalidGeometry per-product in the two .contains? call sites — AdverseFilter.covers? (AIRMET/SIGMET/TFR) and Outlook#covers? (Nimbus SPC outlooks). Bad polygons are skipped silently; the rest of the source continues.
  • AIRMETs from aviationweather.gov occasionally produce self-intersecting rings that pass construction but raise on contains?. Before this fix, a single bad AIRMET surfaced as a partial failure for the entire AIRMET source on every skywatch brief call.

Closes #11.

Test plan

  • New spec: AdverseFilter.covers? with a bowtie-ring SIGMET — does not raise, returns false
  • New spec: Outlook#covers? with a bowtie-ring geometry — does not raise, returns false
  • bundle exec rspec — 447 examples, 0 failures
  • bundle exec rubocop — clean

🤖 Generated with Claude Code

AIRMET (and any source returning hand-drawn polygons) can produce
self-intersecting rings that pass construction but raise
RGeo::Error::InvalidGeometry on contains?. The error surfaced in every
Skywatch.brief call as a partial_failures entry for the whole AIRMET
source.

Rescue InvalidGeometry per-product in the two .contains? call sites
(AdverseFilter.covers? and Outlook#covers?), returning false. Bad
polygons are skipped silently; the rest of the source continues.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jayrav13 jayrav13 merged commit 9c948a5 into main May 2, 2026
3 checks passed
@jayrav13 jayrav13 deleted the fix/airmet-self-intersection branch May 2, 2026 01: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.

AIRMET ingest fails with RGeo::Error::InvalidGeometry: Self-intersection

1 participant