Feat: Aviation weather intelligence API#3
Merged
Conversation
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
There was a problem hiding this comment.
💡 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".
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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
Testing
How did you verify this works?
npx tsc --noEmitpassesdocker compose upScreenshots
If UI changes, include before/after screenshots.