diff --git a/src/main/lemondronor/advisorycircular.cljs b/src/main/lemondronor/advisorycircular.cljs index 0e8ef37..3415a29 100644 --- a/src/main/lemondronor/advisorycircular.cljs +++ b/src/main/lemondronor/advisorycircular.cljs @@ -35,13 +35,17 @@ (defn parse-adsbexchange-ac-element [e] (let [nilstr #(if (= % "") nil %) - numstr #(if (= % "") nil (js/parseFloat %))] + numstr #(if (= % "") nil (js/parseFloat %)) + boolstr #(if (or (= % "1") (= (string/lower-case %) "true")) + true + false)] {:postime (numstr (e "postime")) :lat (numstr (e "lat")) :lon (numstr (e "lon")) :icao (e "icao") :registration (nilstr (e "reg")) :alt (numstr (e "alt")) + :gnd? (boolstr (e "gnd")) :mlat? (= (e "mlat") "1") :speed (numstr (e "spd")) :squawk (nilstr (e "sqk")) @@ -195,7 +199,8 @@ (defn circling? [ac config] - (and (> (geo/flight-curviness (:history ac)) (:curviness-threshold-degrees config)) + (and (> (geo/flight-curviness (filter #(not (:gnd? %)) (:history ac))) + (:curviness-threshold-degrees config)) (> (:alt ac) 300)))