Skip to content

v0.2.47..v0.2.48 changeset ConflateCmd.cpp

Garret Voltz edited this page Sep 27, 2019 · 1 revision
diff --git a/hoot-core/src/main/cpp/hoot/core/cmd/ConflateCmd.cpp b/hoot-core/src/main/cpp/hoot/core/cmd/ConflateCmd.cpp
index 11f9794..d612c6c 100644
--- a/hoot-core/src/main/cpp/hoot/core/cmd/ConflateCmd.cpp
+++ b/hoot-core/src/main/cpp/hoot/core/cmd/ConflateCmd.cpp
@@ -53,6 +53,7 @@
 #include <hoot/core/criterion/ReviewRelationCriterion.h>
 #include <hoot/core/util/StringUtils.h>
 #include <hoot/core/visitors/CountUniqueReviewsVisitor.h>
+#include <hoot/core/util/ConfigUtils.h>
 
 // Standard
 #include <fstream>
@@ -87,7 +88,7 @@ void ConflateCmd::printStats(const QList<SingleStat>& stats)
   }
 }
 
-int ConflateCmd::runSimple(QStringList args)
+int ConflateCmd::runSimple(QStringList& args)
 {
   Timer totalTime;
   Timer t;
@@ -117,6 +118,8 @@ int ConflateCmd::runSimple(QStringList args)
   LOG_VARD(displayStats);
   LOG_VARD(outputStatsFile);
 
+  ConfigUtils::checkForTagValueTruncationOverride();
+
   DiffConflator diffConflator;
 
   bool isDiffConflate = false;
@@ -145,7 +148,11 @@ int ConflateCmd::runSimple(QStringList args)
   if (args.size() != 3)
   {
     cout << getHelp() << endl << endl;
-    throw HootException(QString("%1 takes three parameters.").arg(getName()));
+    throw IllegalArgumentException(
+      QString("%1 takes three parameters. You provided %2: %3")
+        .arg(getName())
+        .arg(args.size())
+        .arg(args.join(",")));
   }
 
   const QString input1 = args[0];
@@ -194,8 +201,8 @@ int ConflateCmd::runSimple(QStringList args)
   ChangesetProviderPtr pTagChanges;
 
   //  Loading order is important if datasource IDs 2 is true but 1 is not
-  if (!ConfigOptions().getReaderConflateUseDataSourceIds1() &&
-       ConfigOptions().getReaderConflateUseDataSourceIds2() &&
+  if (!ConfigOptions().getConflateUseDataSourceIds1() &&
+       ConfigOptions().getConflateUseDataSourceIds2() &&
       !isDiffConflate)
   {
     //  For Attribute conflation, the secondary IDs are the ones that we want
@@ -206,14 +213,14 @@ int ConflateCmd::runSimple(QStringList args)
       _getJobPercentComplete(currentTask - 1),
       "Loading secondary map: ..." + input2.right(maxFilePrintLength) + "...");
     IoUtils::loadMap(
-      map, input2, ConfigOptions().getReaderConflateUseDataSourceIds2(), Status::Unknown2);
+      map, input2, ConfigOptions().getConflateUseDataSourceIds2(), Status::Unknown2);
     currentTask++;
 
     // read input 1
     progress.set(
       _getJobPercentComplete(currentTask - 1),
       "Loading reference map: ..." + input1.right(maxFilePrintLength) + "...");
-    IoUtils::loadMap(map, input1, ConfigOptions().getReaderConflateUseDataSourceIds1(),
+    IoUtils::loadMap(map, input1, ConfigOptions().getConflateUseDataSourceIds1(),
                      Status::Unknown1);
     currentTask++;
   }
@@ -223,8 +230,7 @@ int ConflateCmd::runSimple(QStringList args)
     progress.set(
       _getJobPercentComplete(currentTask - 1),
       "Loading reference map: ..." + input1.right(maxFilePrintLength) + "...");
-    IoUtils::loadMap(map, input1, ConfigOptions().getReaderConflateUseDataSourceIds1(),
-                     Status::Unknown1);
+    IoUtils::loadMap(map, input1, ConfigOptions().getConflateUseDataSourceIds1(), Status::Unknown1);
     currentTask++;
 
     if (isDiffConflate)
@@ -241,7 +247,7 @@ int ConflateCmd::runSimple(QStringList args)
       _getJobPercentComplete(currentTask - 1),
       "Loading secondary map: ..." + input2.right(maxFilePrintLength) + "...");
     IoUtils::loadMap(
-      map, input2, ConfigOptions().getReaderConflateUseDataSourceIds2(), Status::Unknown2);
+      map, input2, ConfigOptions().getConflateUseDataSourceIds2(), Status::Unknown2);
     currentTask++;
   }
 
@@ -277,7 +283,6 @@ int ConflateCmd::runSimple(QStringList args)
 
   size_t initialElementCount = map->getElementCount();
   stats.append(SingleStat("Initial Element Count", initialElementCount));
-  LOG_INFO("Total elements read: " << StringUtils::formatLargeNumber(initialElementCount));
   OsmMapWriterFactory::writeDebugMap(map, "after-load");
 
   if (ConfigOptions().getConflatePreOps().size() > 0)
Clone this wiki locally