Use geometric/corrected altitude.

This commit is contained in:
John Wiseman 2020-07-05 14:11:38 -07:00
parent 9e603728e6
commit 6225efcb86

View File

@ -86,7 +86,11 @@
:lon (numstr (e "lon")) :lon (numstr (e "lon"))
:icao (e "icao") :icao (e "icao")
:registration (nilstr (e "reg")) :registration (nilstr (e "reg"))
;; Altitude in feet at standard pressure.
:alt (numstr (e "alt")) :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")) :gnd? (boolstr (e "gnd"))
:mlat? (= (e "mlat") "1") :mlat? (= (e "mlat") "1")
:speed (numstr (e "spd")) :speed (numstr (e "spd"))
@ -145,7 +149,7 @@
(let [icao (:icao ac) (let [icao (:icao ac)
new-history-entry {:lat (:lat ac) new-history-entry {:lat (:lat ac)
:lon (:lon ac) :lon (:lon ac)
:alt (:alt ac) :alt (:geom-alt ac)
:gnd? (:gnd? ac) :gnd? (:gnd? ac)
:time (:postime ac)}] :time (:postime ac)}]
(if (contains? db icao) (if (contains? db icao)
@ -236,7 +240,7 @@
(defn ac-desc [ac] (defn ac-desc [ac]
(str (:icao ac) " " "http://tar1090.adsbexchange.com/?icao=" (:icao ac) (str (:icao ac) " " "http://tar1090.adsbexchange.com/?icao=" (:icao ac)
" " (:lat ac) " " (:lon ac) " " (:lat ac) " " (:lon ac)
" " (:registration ac) " " (:alt ac) " " (:curviness ac) " " " " (:registration ac) " " (:geom-alt ac) " " (:curviness ac) " "
(:normalized-curviness ac))) (:normalized-curviness ac)))
@ -567,7 +571,7 @@
:geometry :geometry
{:type "LineString" {:type "LineString"
:coordinates (map (fn [pos] :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)}}) coords)}})