mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-21 02:32:18 +00:00
Keep a landed aircraft on the ground, not at its approach height
A grounded row with no altitude fell back to the aircraft's sticky altitude, which straight after a landing is still the approach height. Military contacts then hung there for as long as they stayed on the ground (the grounded floor only ever raises a height); civil contacts held it until the ground cell under them warmed, which for a contact far from the viewer is never. The 3D model is ground-snapped on its own, so the plane dropped when the model took over. A grounded contact with no altitude now uses only an altitude it gave on the ground, else the ground fallback. Labels, the tracked readout and the follow distance read "On the ground" / no flight level instead of the approach altitude.
This commit is contained in:
1 parent
20620e89bf
commit
9b10489454
8 files changed
+145
-26
No files matched your search
@@ -70,19 +70,25 @@ export class MilitaryFlightRecords {
|
||||
this.missingPolls.delete(icao24);
|
||||
const prevMeta = this.data.get(icao24);
|
||||
// adsb.lol/readsb reports GROUND traffic as alt_baro === "ground" (no
|
||||
// separate boolean). Grounded planes fall back to their last known
|
||||
// altitude (field elevation is unknowable here), else 0 m — never the
|
||||
// 3 km airborne default (a parked plane must not float).
|
||||
// separate boolean). Grounded planes fall back to an altitude they
|
||||
// reported while on the ground (field elevation is unknowable here),
|
||||
// else 0 m — never the 3 km airborne default, and never the last
|
||||
// AIRBORNE altitude: `altitudeFt` is sticky across the landing, so it
|
||||
// still holds the approach height, and the icon would hang there while
|
||||
// the ground-snapped model sits on the field (a parked plane must not
|
||||
// float). `groundAltitudeM` is that ground-only altitude: set by a
|
||||
// grounded report that carries one, held while grounded, dropped on
|
||||
// takeoff.
|
||||
const onGround = aircraft.onGround;
|
||||
const altitudeFt =
|
||||
aircraft.baroAltitudeM == null ? null : aircraft.baroAltitudeM / 0.3048;
|
||||
const groundAltitudeM = onGround
|
||||
? (aircraft.baroAltitudeM ??
|
||||
(prevMeta?.onGround === true ? prevMeta.groundAltitudeM : null) ??
|
||||
null)
|
||||
: null;
|
||||
const altitudeM =
|
||||
aircraft.baroAltitudeM ??
|
||||
(onGround
|
||||
? Number.isFinite(prevMeta?.altitudeFt)
|
||||
? prevMeta.altitudeFt * 0.3048
|
||||
: 0
|
||||
: 3048);
|
||||
aircraft.baroAltitudeM ?? (onGround ? (groundAltitudeM ?? 0) : 3048);
|
||||
const verticalRateMps = aircraft.verticalRateMps;
|
||||
const callsign = aircraft.callsign;
|
||||
const type = aircraft.typeCode;
|
||||
@@ -198,6 +204,7 @@ export class MilitaryFlightRecords {
|
||||
registration: stickyText(registration, prevMeta?.registration),
|
||||
operator: stickyText(operator, prevMeta?.operator),
|
||||
altitudeFt: stickyNumber(altitudeFt, prevMeta?.altitudeFt, null),
|
||||
groundAltitudeM,
|
||||
// geoAltitudeM/renderAltitudeM are ADDITIVE fields alongside the
|
||||
// untouched aviation `altitudeFt` — never rename/replace it (labels,
|
||||
// the FL readout, and the landed-fast-cull heuristic all still read
|
||||
|
||||
Reference in new issue
Block a user