feat(natural): add tropical cyclone tracking from NHC and GDACS (#1357)

* feat(natural): add tropical cyclone tracking from NHC and GDACS

Integrate NHC ArcGIS REST API (15 storm slots across AT/EP/CP basins)
and GDACS TC field extraction to provide real-time tropical cyclone data
with forecast tracks, uncertainty cones, and historical track paths.

- Proto: add optional TC fields (storm_id, wind_kt, pressure_mb, etc.)
  plus ForecastPoint, PastTrackPoint, CoordRing messages
- Server/seed: NHC two-pass query (forecast points then detail layers),
  GDACS wind/pressure parsing, Saffir-Simpson classification, dedup
  strategy (NHC > GDACS > EONET), pressureMb validation (850-1050),
  advisory date with Number.isFinite guard
- Globe: dashed red forecast track, per-segment wind-colored past track,
  semi-transparent orange forecast cone polygon
- Popup: TC details panel with color-coded category badge, wind/pressure
- Frontend mapper: forward all TC fields, convert CoordRing to number[][][]

* fix(natural): improve GDACS dedup, NHC classification, and TC popup i18n

- GDACS dedup now checks name + geographic proximity instead of name-only
- NHC classification uses stormtype field for subtropical/post-tropical
- TC popup labels use t() for localization instead of hardcoded English

* feat(map): add cyclone-specific deck.gl layers for 2D map

- Storm center ScatterplotLayer with Saffir-Simpson wind coloring
- Past track PathLayer with per-segment wind-speed color ramp
- Forecast track PathLayer with dashed line via PathStyleExtension
- Cone PolygonLayer for forecast uncertainty visualization
- Tooltip and click routing for all new storm layer IDs

* fix(map): remove click routing for synthetic storm track/cone layers

Track and cone layers carry lightweight objects without full NaturalEvent
fields. Clicking them would pass incomplete data to the popup renderer.
Only storm-centers-layer (which holds the full NaturalEvent) routes to
the natEvent popup. Tracks and cones remain tooltip-only.

* fix(map): attach parent NaturalEvent to synthetic storm layers for clicks

Synthetic track/cone objects now carry _event reference to the parent
NaturalEvent. Click handler unwraps _event before passing to popup,
so clicking any storm element opens the full TC popup.
This commit is contained in:
Elie Habib
2026-03-10 07:23:07 +04:00
committed by GitHub
parent fc134647a5
commit 78e7ae546e
13 changed files with 1039 additions and 35 deletions

View File

@@ -115,3 +115,89 @@ components:
type: string
closed:
type: boolean
stormId:
type: string
description: Optional tropical cyclone fields (populated for severeStorms from GDACS TC / NHC)
stormName:
type: string
basin:
type: string
stormCategory:
type: integer
format: int32
classification:
type: string
windKt:
type: integer
format: int32
pressureMb:
type: integer
format: int32
movementDir:
type: integer
format: int32
movementSpeedKt:
type: integer
format: int32
forecastTrack:
type: array
items:
$ref: '#/components/schemas/ForecastPoint'
conePolygon:
type: array
items:
$ref: '#/components/schemas/CoordRing'
pastTrack:
type: array
items:
$ref: '#/components/schemas/PastTrackPoint'
ForecastPoint:
type: object
properties:
lat:
type: number
format: double
lon:
type: number
format: double
hour:
type: integer
format: int32
windKt:
type: integer
format: int32
category:
type: integer
format: int32
CoordRing:
type: object
properties:
points:
type: array
items:
$ref: '#/components/schemas/Coordinate'
Coordinate:
type: object
properties:
lon:
type: number
format: double
lat:
type: number
format: double
PastTrackPoint:
type: object
properties:
lat:
type: number
format: double
lon:
type: number
format: double
windKt:
type: integer
format: int32
timestamp:
type: integer
format: int64
description: 'Warning: Values > 2^53 may lose precision in JavaScript'