Filter out aircraft on the ground(!).

This commit is contained in:
John Wiseman 2020-05-11 16:51:46 -07:00
parent 8e095ffd6c
commit bc3f3210d7

View File

@ -87,6 +87,7 @@
new-history-entry {:lat (:lat ac)
:lon (:lon ac)
:alt (:alt ac)
:gnd? (:gnd? ac)
:time (:postime ac)}]
(if (contains? db icao)
(let [old-record (db icao)
@ -205,7 +206,7 @@
(defn circling2? [ac config]
(let [relevant-history (filter #(and (:alt %) (> (:alt %) 300)) (:history ac))]
(let [relevant-history (filter #(not (:gnd? %)) (:history ac))]
(and (> (geo/flight-curviness relevant-history) (:curviness-threshold-degrees config))
(> (:alt ac) 300))))
@ -505,7 +506,9 @@
(do
(p/let [coarse (pelias/reverse (:pelias config) lat lon {:layers "coarse"})]
(let [coarse (first (:features coarse))]
(log-info "%s: Reverse geocode: %s" icao (:properties coarse))
(if (:properties coarse)
(log-info "%s: Reverse geocode: %s" icao (:properties coarse))
(log-error "%s: Reverse geocode failed: %s" icao coarse))
;; Note that if we're over the ocean we get null :(
(p/then (p/all [(screenshot (:icao ac) lat lon now (:screenshot config))
(p/let [nearby (landmark config lat lon)
@ -513,7 +516,7 @@
sqb (if-let [sqb-path (:basestation-sqb config)]
(get-basestation-sqb-record icao sqb-path))]
(let [description (generate-description ac sqb coarse nearby)]
(log-info "Description: %s" description)
(log-info "%s Description: %s" (:icao ac) description)
description))])
(fn [[image-path description]]
(if (or (nil? coarse)
@ -670,7 +673,7 @@
(write-history-db new-db (:history-db-path config))
(let [end-time (current-time)]
(log-info
"Completed processing in %f seconds: tracking %s aircraft; %s potential circles; top curvinesses: %s"
"Finished in %f s: %s aircraft; %s circles; top curvinesses: %s"
(/ (- end-time start-time) 1000)
(count new-db)
(count potential-circles)