        (>= (Math/abs ^double (:lon (:position r))) 0.1)))
 
 
-(defn random-rgb []
-  (map #(rand-int %) (repeat 3 255)))
-
 (defn rgb-hex [rgb]
   (str "7f" (string/join (map #(format "%02x" %) rgb))))
 

         [:width 4]]
        [:PolyStyle
         [:color "7f00ff00"]]])
     path-colors)
    tracks]])



(defn -main [& args]
  (let [args (gflags/parse-flags (cons nil args))]
    (load-extended-data)
    (let [vehicle-groups (->> args
                              (mapcat orbdet/read-log)
                              (filter-icaos (gflags/flags :icaos))
                              (filter has-position?)
                              (print-count)
                              (partition-all 1000)
                              (mapcat distinct)
                              (print-count)
                              (group-by :icao))
          kml-tracks (->> vehicle-groups
                          (map second)
                          (map #(filter-speed 30000.0 %))
                          (mapcat #(partition-sessions 600000 %))
                          (map distinct)
                          (filter #(> (count %) 10))
                          (map-indexed kmltrack))]
      (-> (kmldoc vehicle-groups kml-tracks)
          xml/sexp-as-element
          xml/emit-str
          println))))
