     (with-open [w (clojure.java.io/writer (str ".test-files/close-features-single-collection-" c ".json"))]
       (random-json-features w "closeset" "collection1" c :close? true))))
 
+(defn generate-test-files-with-deletes []
+  (doseq [c [10 100 1000 10000 100000]]
+    (with-open [w (clojure.java.io/writer (str ".test-files/delete-features-single-collection-" c ".json"))]
+      (random-json-features w "deleteset" "collection1" c :delete? true))))
+
 (defn generate-test-files-with-nested-feature []
   (doseq [c [5 50 500 5000 50000]]
     (with-open [w (clojure.java.io/writer (str ".test-files/new-features-nested-feature-" c ".json"))]

    attributes))

(defn random-json-features [out-stream dataset collection total & args]
  (let [{:keys [change? close? nested geometry?] :or {change? false close? false nested 0 geometry? true}} args
        validity (tf/unparse date-time-formatter (local-now))
        attributes (create-attributes 3)
        new-features (repeatedly #(random-new-feature collection attributes))
        with-nested (map #(combine-to-nested-feature % "nested" geometry?) (partition (+ 1 nested) new-features))
        with-extra (mapcat #(followed-by % change? close?) with-nested)
        package {:_meta {}
                 :dataset dataset
                 :features (take total with-extra)}]

      1 (assoc base attr (first nested-features))
      (assoc base attr (into [] nested-features)))))

(defn followed-by [feature change? close? delete?]
  (let [change (fn [f] (selective-feature (transform-to-change f)))
        close  (fn [f] (selective-feature (transform-to-close f)))
        delete (fn [f] (selective-feature (transform-to-delete f)))
        result [feature]
        result (if change?
                 (conj result (change feature))
                 result)
        result (if close?
                 (conj result (close feature))
                 result)
        result (if delete?
                 (conj result (delete feature))
                 result)]
    result))

