Skip to content

v0.2.48..v0.2.49 changeset ChangesetCreator.h

Garret Voltz edited this page Oct 2, 2019 · 1 revision
diff --git a/hoot-core/src/main/cpp/hoot/core/algorithms/changeset/ChangesetCreator.h b/hoot-core/src/main/cpp/hoot/core/algorithms/changeset/ChangesetCreator.h
index 7bcd6c9..5a28e89 100644
--- a/hoot-core/src/main/cpp/hoot/core/algorithms/changeset/ChangesetCreator.h
+++ b/hoot-core/src/main/cpp/hoot/core/algorithms/changeset/ChangesetCreator.h
@@ -31,7 +31,6 @@
 #include <hoot/core/elements/OsmMap.h>
 #include <hoot/core/io/ElementInputStream.h>
 #include <hoot/core/util/Progress.h>
-#include <hoot/core/algorithms/changeset/ChangesetDeriver.h>
 
 namespace hoot
 {
@@ -68,10 +67,17 @@ public:
 
   static const QString JOB_SOURCE;
 
+  /**
+   * Constructor
+   *
+   * @param printStats prints statistics for the output changeset
+   * @param osmApiDbUrl URL to an OSM API database used to calculate element IDs; required only if
+   * the output changeset is of type .osc.sql.
+   */
   ChangesetCreator(const bool printStats = false, const QString osmApiDbUrl = "");
 
   /**
-   * Writes the changeset between one or two inputs to an output file. If only one input is
+   * Writes a changeset between one or two inputs to an output file. If only one input is
    * specified, the resulting changeset will be made entirely of the elements from the input.
    *
    * @param output the changeset output file target
@@ -81,15 +87,29 @@ public:
   void create(const QString& output, const QString& input1, const QString& input2 = "");
 
   /**
-   * Writes the changeset between one or two maps to an output file. If only one input is
-   * specified, the resulting changeset will be made entirely of the elements from the input.
+   * Writes a changeset between two maps to an output file.
    *
    * @param map1 the first input source
-   * @param map2 the optional second input source
+   * @param map2 the second input source
    * @param output the changeset output file target
    */
   void create(OsmMapPtr& map1, OsmMapPtr& map2, const QString& output);
 
+  /**
+   * Writes a single combined changeset between multiple sets of maps to an output file. The number
+   * of maps in each set must be equal to each other
+   *
+   * @param map1Inputs A set of maps with the original state of the data.
+   * @param map2Inputs A set of maps with the new state of the data.
+   * @param output the changeset output file target
+   */
+  void create(const QList<OsmMapPtr>& map1Inputs, const QList<OsmMapPtr>& map2Inputs,
+              const QString& output);
+
+  int getNumCreateChanges() const { return _numCreateChanges; }
+  int getNumModifyChanges() const { return _numModifyChanges; }
+  int getNumDeleteChanges() const { return _numDeleteChanges; }
+
 private:
 
   friend class ChangesetReplacementCreatorTest;
@@ -105,7 +125,9 @@ private:
   // provided.
   bool _singleInput;
 
-  ChangesetDeriverPtr _changesetDeriver;
+  int _numCreateChanges;
+  int _numModifyChanges;
+  int _numDeleteChanges;
 
   bool _isSupportedOutputFormat(const QString& format) const;
   bool _inputIsSorted(const QString& input) const;
@@ -143,6 +165,8 @@ private:
    */
   void _streamChangesetOutput(ElementInputStreamPtr input1, ElementInputStreamPtr input2,
                               const QString& output);
+  void _streamChangesetOutput(const QList<ElementInputStreamPtr>& inputs1,
+                              const QList<ElementInputStreamPtr>& inputs2, const QString& output);
 };
 
 }
Clone this wiki locally