From bc3f3210d71e40f8a693058a575282a9a5a9fe93 Mon Sep 17 00:00:00 2001 From: John Wiseman Date: Mon, 11 May 2020 16:51:46 -0700 Subject: [PATCH] Filter out aircraft on the ground(!). --- src/main/lemondronor/advisorycircular.cljs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/lemondronor/advisorycircular.cljs b/src/main/lemondronor/advisorycircular.cljs index 3415a29..d3f568e 100644 --- a/src/main/lemondronor/advisorycircular.cljs +++ b/src/main/lemondronor/advisorycircular.cljs @@ -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)