From 6225efcb86ec2f925523253f60994fbea2de4e91 Mon Sep 17 00:00:00 2001 From: John Wiseman Date: Sun, 5 Jul 2020 14:11:38 -0700 Subject: [PATCH] Use geometric/corrected altitude. --- src/main/lemondronor/advisorycircular.cljs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/lemondronor/advisorycircular.cljs b/src/main/lemondronor/advisorycircular.cljs index a9ccfbe..e28b5dd 100644 --- a/src/main/lemondronor/advisorycircular.cljs +++ b/src/main/lemondronor/advisorycircular.cljs @@ -86,7 +86,11 @@ :lon (numstr (e "lon")) :icao (e "icao") :registration (nilstr (e "reg")) + ;; Altitude in feet at standard pressure. :alt (numstr (e "alt")) + ;; The altitude adjusted for local air pressure, should be + ;; roughly the height above mean sea level. + :geom-alt (numstr (e "galt")) :gnd? (boolstr (e "gnd")) :mlat? (= (e "mlat") "1") :speed (numstr (e "spd")) @@ -145,7 +149,7 @@ (let [icao (:icao ac) new-history-entry {:lat (:lat ac) :lon (:lon ac) - :alt (:alt ac) + :alt (:geom-alt ac) :gnd? (:gnd? ac) :time (:postime ac)}] (if (contains? db icao) @@ -236,7 +240,7 @@ (defn ac-desc [ac] (str (:icao ac) " " "http://tar1090.adsbexchange.com/?icao=" (:icao ac) " " (:lat ac) " " (:lon ac) - " " (:registration ac) " " (:alt ac) " " (:curviness ac) " " + " " (:registration ac) " " (:geom-alt ac) " " (:curviness ac) " " (:normalized-curviness ac))) @@ -567,7 +571,7 @@ :geometry {:type "LineString" :coordinates (map (fn [pos] - [(:lon pos) (:lat pos) (util/feet-to-meters (:alt pos))]) + [(:lon pos) (:lat pos) (util/feet-to-meters (:geom-alt pos))]) coords)}})