          :altitude (:altitude r)
          :speed (:speed r)
          :heading (:heading r)
-         :squawk (sql-str (:squawk r))}]
+         :squawk (sql-str (:squawk r))
+         :provenance (if (= :provenance :mlat) 2 1)}]
     (if (has-position? r)
       (assoc db-rec
              :lat (:lat r)

            (zero? (:lon r)))))


(defn log-record-to-db-record [r]
  (let [db-rec
        {:timestamp (sql-str (timefmt/unparse db-timestamp-formatter (:timestamp r)))
         :icao (sql-str (:icao r))


(gflags/define-integer "time-window-secs"
  1
  (str "Only 1 ping will be recorded for each aircraft during each interval of"
       " the specified length."))

(gflags/define-boolean "with-position-only"
  false
