    records))
 
 
-(defn kmldoc [tracks]
+(defn kmldoc [vehicle-groups tracks]
   [:kml {:xmlns "http://www.opengis.net/kml/2.2"}
    [:Document
     [:name "Recent law enforcement aircraft tracks"]
     [:description
-     (str (count tracks) " sessions")]
+     (str
+      (count vehicle-groups) " vehicles, "
+      (count tracks) " sessions, "
+      (format "%.1f km flown"
+              (/ (reduce
+                  +
+                  (for [[_ reports] vehicle-groups]
+                    (reduce + (map distance reports (next reports)))))
+                 1000.0)))]
     (map-indexed
      (fn [idx color]
        [:Style {:id (str "color" idx)}

  (:Agency (extended-data icao)))


(defn type [icao]
  (:Type (extended-data icao)))



(defn has-position? [r]



(def path-colors
  (cycle
   [
    0xA6CEE3
    0x1F78B4
    0xB2DF8A
    0x33A02C
    0xFB9A99
    0xE31A1C
    0xFDBF6F
    0xFF7F00
    0xCAB2D6
    0xFF0000
    0x00FF00
    0x0000FF
    0xF15854 ;; (red))
    0xB276B2 ;; (purple)
    0xDECF3F ;; (yellow)
    0x4D4D4D ;; (gray)
    0x5DA5DA ;; (blue)
    0xFAA43A ;; (orange)
    0x60BD68 ;; (green)
    0xF17CB0 ;; (pink)
    0xB2912F ;; (brown)
    ]))


(defn feet-to-meters [f]
