snstac / adsbxcot

Display Aircraft in TAK
https://adsbxcot.rtfd.io
Apache License 2.0
51 stars 14 forks source link

API v2 fail down to Baro Alt Calc when MLAT has no GNSS_ALT #11

Open ghost opened 3 years ago

ghost commented 3 years ago

https://www.adsbexchange.com/version-2-api-wip/

alt_baro: the aircraft barometric altitude in feet
alt_geom: geometric (GNSS / INS) altitude in feet referenced to the WGS84 ellipsoid

MLAT traffic tracks do not have the API alt_geom populated. This results in a CoT hae="9999999" value and does not work for 3D awareness.

For MLAT traffic tracks, if alt_geom is not populated, fail down to use alt_baro value, and calculate HAE based on:

Request a normal ADS-B aircraft with alt_geom within 25 NM of MLAT traffic of interest, compare the full ADS-B aircraft's alt_geom to alt_baro to calculate offset to apply to the MLAT target's alt_baro to get the missing alt_geom. Then use this "CALCULATED" geometric altitude in place of a missing alt_geom API value.