Added altitude to geojson.
This commit is contained in:
parent
79e675b263
commit
3e840690be
@ -443,7 +443,9 @@
|
||||
:properties props
|
||||
:geometry
|
||||
{:type "LineString"
|
||||
:coordinates (map (fn [pos] [(:lon pos) (:lat pos)]) coords)}})
|
||||
:coordinates (map (fn [pos]
|
||||
[(:lon pos) (:lat pos) (util/feet-to-meters (:alt pos))])
|
||||
coords)}})
|
||||
|
||||
|
||||
(defn track->geojson [older-positions recent-positions icao centroid]
|
||||
|
@ -49,6 +49,16 @@
|
||||
selector))
|
||||
|
||||
|
||||
(defn tar1090-url [icao options]
|
||||
(let [url (gstring/format
|
||||
"https://tar1090.adsbexchange.com/?icao=%s&zoom=%s&noIsolation&hideButtons&hideSidebar"
|
||||
icao
|
||||
(or (:zoom options) 14))]
|
||||
(if (:simple-tracks options)
|
||||
(str url "&monochromeMarkers=ffff55&monochromeTracks=010101&outlineColor=505050")
|
||||
url)))
|
||||
|
||||
|
||||
(defn screenshot-aircraft
|
||||
([icao lat lon]
|
||||
(screenshot-aircraft icao lat lon {}))
|
||||
@ -72,7 +82,7 @@
|
||||
(if-let [user-agent (:user-agent options)]
|
||||
(.setUserAgent page user-agent))
|
||||
(log-debug "Navigating")
|
||||
(let [url (gstring/format "https://tar1090.adsbexchange.com/?icao=%s&zoom=%s&noIsolation&hideButtons&hideSidebar&monochromeMarkers=ffff55&monochromeTracks=010101&outlineColor=505050" icao (or (:zoom options) 14))]
|
||||
(let [url (tar1090-url icao options)]
|
||||
(log-info "Getting screenshot at url %s with zoom %s" url (or (:zoom options) 14))
|
||||
(p/all [(.waitForNavigation page)
|
||||
(.goto page
|
||||
|
@ -97,3 +97,7 @@
|
||||
(.getUTCMinutes date)
|
||||
(.getUTCSeconds date)
|
||||
(.getUTCMilliseconds date))))
|
||||
|
||||
|
||||
(defn feet-to-meters [f]
|
||||
(* f 0.3048))
|
||||
|
Loading…
Reference in New Issue
Block a user