Skip to content

Feat: Aviation weather intelligence API#3

Merged
cwdaniel merged 3 commits into
mainfrom
aviation-weather-api
Apr 9, 2026
Merged

Feat: Aviation weather intelligence API#3
cwdaniel merged 3 commits into
mainfrom
aviation-weather-api

Conversation

@cwdaniel

@cwdaniel cwdaniel commented Apr 9, 2026

Copy link
Copy Markdown
Owner

Situation Awareness API

Aviation weather intelligence API that translates composite radar tiles into structured JSON for ground operations
teams. Runs as a separate microservice alongside the existing tile server.

What it does

Samples live composite radar data (MBTiles) to compute dBZ intensity, precipitation types, severity levels, and ramp
status for any airport by ICAO code. Supports range ring analysis (5/20/50nm), flight route corridor sampling,
precipitation cell polygon extraction via GDAL, rolling condition history, and real-time WebSocket notifications when
conditions change at watched airports.

Endpoints

  • GET /situation/airport/:icao — radar conditions across three range rings
  • GET /situation/summary — system-wide snapshot across 8 defined regions
  • GET /situation/route?waypoints=KMIA,KATL — radar sampling along a flight corridor
  • GET /situation/airport/:icao/history?hours=3 — rolling condition history for watched airports
  • GET /overlays/cells.geojson?threshold=40 — active precipitation cells as GeoJSON polygons
  • WS /ws/aviation — subscribe to condition changes with per-client threshold filtering

Architecture

New situation-api Docker service using the same image, different entrypoint (node dist/situation/index.js). Subscribes
to the existing new-frame Redis pub/sub from the compositor. Pre-computes stats for WebSocket-watched airports, falls
back to on-demand tile sampling for ad-hoc queries. Traefik routes /situation/, /overlays/, /ws/aviation to port
8601.

Files added/changed

  • src/situation/ — 20 new source files (types, config, sampling, analysis, routes, WebSocket, worker)
  • src/utils/geo.ts — added haversine, bearing, Mercator conversion functions
  • src/config/env.ts — added situationPort, samplingZoom, airportsOverridePath
  • data/airports.json — 29,918 airports from OurAirports
  • scripts/generate-airports.ts — airport data generation script
  • tests/unit/situation/ — 12 test files, 79 new tests
  • docker-compose.yml — added situation-api service
  • docker/Dockerfile — no changes to build steps
  • vitest.config.ts — switched to forks pool for Windows WebSocket test compatibility
  • package.json — added @types/geojson devDependency

Testing

How did you verify this works?

  • [x ] npx tsc --noEmit passes
  • [ x] Docker builds successfully
  • [ x] Tested locally with docker compose up
  • Verified in browser at radrview.com

Screenshots

If UI changes, include before/after screenshots.

 Situation Awareness API

  Aviation weather intelligence API that translates composite radar tiles into structured JSON for ground operations
  teams. Runs as a separate microservice alongside the existing tile server.

  What it does

  Samples live composite radar data (MBTiles) to compute dBZ intensity, precipitation types, severity levels, and ramp
  status for any airport by ICAO code. Supports range ring analysis (5/20/50nm), flight route corridor sampling,
  precipitation cell polygon extraction via GDAL, rolling condition history, and real-time WebSocket notifications when
  conditions change at watched airports.

  Endpoints

  - GET /situation/airport/:icao — radar conditions across three range rings
  - GET /situation/summary — system-wide snapshot across 8 defined regions
  - GET /situation/route?waypoints=KMIA,KATL — radar sampling along a flight corridor
  - GET /situation/airport/:icao/history?hours=3 — rolling condition history for watched airports
  - GET /overlays/cells.geojson?threshold=40 — active precipitation cells as GeoJSON polygons
  - WS /ws/aviation — subscribe to condition changes with per-client threshold filtering

  Architecture

  New situation-api Docker service using the same image, different entrypoint (node dist/situation/index.js). Subscribes
   to the existing new-frame Redis pub/sub from the compositor. Pre-computes stats for WebSocket-watched airports, falls
   back to on-demand tile sampling for ad-hoc queries. Traefik routes /situation/*, /overlays/*, /ws/aviation to port
  8601.

  Files added/changed

  - src/situation/ — 20 new source files (types, config, sampling, analysis, routes, WebSocket, worker)
  - src/utils/geo.ts — added haversine, bearing, Mercator conversion functions
  - src/config/env.ts — added situationPort, samplingZoom, airportsOverridePath
  - data/airports.json — 29,918 airports from OurAirports
  - scripts/generate-airports.ts — airport data generation script
  - tests/unit/situation/ — 12 test files, 79 new tests
  - docker-compose.yml — added situation-api service
  - docker/Dockerfile — no changes to build steps
  - vitest.config.ts — switched to forks pool for Windows WebSocket test compatibility
  - package.json — added @types/geojson devDependency

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c17d3c04a7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/situation/ws/aviation.ts Outdated
Comment thread src/situation/index.ts
Comment thread src/situation/sampling/route-sampler.ts Outdated
cwdaniel added 2 commits April 8, 2026 23:37
P2 Badge Sample adjacent tiles for neighborhood max dBZ

Neighborhood sampling reads only the tile containing the waypoint (tiles[0]) and then discards out-of-bounds neighbor pixels, so when a sample falls near a tile boundary, high dBZ just across the seam is ignored. This underestimates maxDbzAlongRoute, severity, and recommendation for routes that cross tile edges.
@cwdaniel cwdaniel merged commit c36894a into main Apr 9, 2026
1 check passed
@cwdaniel cwdaniel deleted the aviation-weather-api branch April 9, 2026 05:11
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.

1 participant