diff --git a/src/main/lemondronor/circlebot.cljs b/src/main/lemondronor/circlebot.cljs index 808fc91..54b587c 100644 --- a/src/main/lemondronor/circlebot.cljs +++ b/src/main/lemondronor/circlebot.cljs @@ -288,6 +288,9 @@ (first results))) +(defn km->miles [km] + (* km 0.621371)) + (defn generate-description [ac reverse wiki-nearby nearby] (let [rev-props (:properties reverse) nearby (:properties (first nearby)) @@ -298,10 +301,10 @@ :militaryicao (:icao ac))) wiki-nearby (assoc :nearbylandmark (:name wiki-nearby) - :nearbydistance (:distance wiki-nearby)) + :nearbydistance (-> wiki-nearby :distance km->miles)) (and nearby (not wiki-nearby)) (assoc :nearbylandmark (:name nearby) - :nearbydistance (:distance nearby)) + :nearbydistance (-> nearby :distance km->miles)) (:speed ac) (assoc :speed (.toFixed (* (:speed ac) 1.15078) 0)) (= (:registration ac) (:callsign ac)) @@ -332,7 +335,7 @@ airport-properties (:properties airport)] (log-info "%s: Recent centroid is %s %s" icao lat lon) (if airport - (log-info "%s: Closest airport is %s, distance: %s" + (log-info "%s: Closest airport is %s, distance: %s km" (:icao ac) (:label airport-properties) (:distance airport-properties)) (log-info "%s: No airports nearby" (:icao ac))) (if (and airport-properties (<= (:distance airport-properties) minimum-airport-distance-km))