Skip to content

feat(brief): coordinate input — Skywatch.brief(at: [lat, lon]) (#6)#19

Merged
jayrav13 merged 1 commit into
mainfrom
feat/brief-coord-input
May 2, 2026
Merged

feat(brief): coordinate input — Skywatch.brief(at: [lat, lon]) (#6)#19
jayrav13 merged 1 commit into
mainfrom
feat/brief-coord-input

Conversation

@jayrav13

@jayrav13 jayrav13 commented May 2, 2026

Copy link
Copy Markdown
Owner

Summary

Adds coordinate input to `Skywatch.brief` alongside the existing airport keyword. For coord queries, the composer:

  • finds the nearest reporting station via a bbox METAR query (`Metar#fetch_nearest`)
  • uses requested coords for WFO lookup, AFD selection, and adverse-conditions polygon checks
  • uses the nearest station's airport ID for TAF, winds aloft, and PIREPs
  • attaches a `note` field describing the data source + distance, with a WARNING when the nearest station is more than 25 nm away

CLI auto-detects `LAT,LON` vs airport ID:

```
skywatch brief KCDW
skywatch brief 40.688,-74.174
```

Closes #6. First PR in the v1 sprint to extend Skywatch.brief — PR B (ETD #7) and PR C (route #5) follow.

Test plan

  • `Metar#fetch_nearest` specs: closest-by-distance, empty bbox, missing-coord stations, bbox-query shape
  • Composer specs: airport+at exclusivity, nearest-station note, far-station warning, no-METAR raise, requested-coord polygon containment
  • Brief model: optional `note:` field omitted when nil
  • CLI: `LAT,LON` parsing + non-zero exit on bad floats
  • Backward compat: existing airport flow + `Skywatch.brief(airport:)` API unchanged
  • `bundle exec rspec` — 461 examples, 0 failures
  • `bundle exec rubocop` — clean

🤖 Generated with Claude Code

#6)

Adds coordinate input to Skywatch.brief alongside the existing airport: kw.
For coord queries, the composer:

- finds the nearest reporting station via a bbox METAR query around the
  requested point (Metar#fetch_nearest)
- uses the requested coordinates for WFO lookup, AFD selection, and
  adverse-conditions polygon containment
- uses the nearest station's airport ID for TAF, winds aloft, and PIREPs
- attaches a `note:` describing the data source + distance, with a
  WARNING when the nearest station is more than 25 nm away

CLI accepts either an airport ID (KCDW) or "LAT,LON" (40.688,-74.174):

    skywatch brief KCDW
    skywatch brief 40.688,-74.174

Closes #6.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jayrav13 jayrav13 merged commit e25a658 into main May 2, 2026
3 checks passed
@jayrav13 jayrav13 deleted the feat/brief-coord-input branch May 2, 2026 01:27
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.

Skywatch.brief: support coordinate input (at: [lat, lon])

1 participant