v0.2.48..v0.2.49 changeset ConflateCmd.cpp
Garret Voltz edited this page Oct 2, 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 d612c6c..998948a 100644
--- a/hoot-core/src/main/cpp/hoot/core/cmd/ConflateCmd.cpp
+++ b/hoot-core/src/main/cpp/hoot/core/cmd/ConflateCmd.cpp
@@ -54,6 +54,7 @@
#include <hoot/core/util/StringUtils.h>
#include <hoot/core/visitors/CountUniqueReviewsVisitor.h>
#include <hoot/core/util/ConfigUtils.h>
+#include <hoot/core/elements/OsmUtils.h>
// Standard
#include <fstream>
@@ -106,7 +107,7 @@ int ConflateCmd::runSimple(QStringList& args)
//remove "--stats" from args list
args.pop_back();
}
- else if (args[args.size() - 1] == "--stats")
+ else if (args[args.size() - 2] == "--stats")
{
displayStats = true;
outputStatsFile = args[args.size() - 1];
@@ -235,6 +236,11 @@ int ConflateCmd::runSimple(QStringList& args)
if (isDiffConflate)
{
+ if (output.endsWith(".osc"))
+ {
+ OsmUtils::checkVersionLessThanOneCountAndLogWarning(map);
+ }
+
// Store original IDs for tag diff
progress.set(
_getJobPercentComplete(currentTask - 1), "Storing original features for tag differential...");
@@ -475,37 +481,9 @@ void ConflateCmd::_updatePostConfigOptionsForAttributeConflation()
// we have a better solution for changing these opts in place.
if (ConfigOptions().getHighwayMergeTagsOnly())
{
- // If we're running Attribute Conflation and removing building relations, we need to remove them
- // after the review relations have been removed or some building relations may still remain that
- // are involved in reviews.
-
- const QString buildingOutlineUpdateOpName =
- QString::fromStdString(BuildingOutlineUpdateOp::className());
- const QString removeElementsVisitorName =
- QString::fromStdString(RemoveElementsVisitor::className());
const QString reviewRelationCritName =
QString::fromStdString(ReviewRelationCriterion::className());
- QStringList postConflateOps = ConfigOptions().getConflatePostOps();
- LOG_DEBUG("Post conflate ops before Attribute Conflation adjustment: " << postConflateOps);
- // Currently, all these things will be true if we're running Attribute Conflation, but I'm
- // specifying them anyway to harden this a bit.
- if (ConfigOptions().getBuildingOutlineUpdateOpRemoveBuildingRelations() &&
- postConflateOps.contains(removeElementsVisitorName) &&
- ConfigOptions().getRemoveElementsVisitorElementCriteria().contains(
- reviewRelationCritName) &&
- postConflateOps.contains(buildingOutlineUpdateOpName))
- {
- const int removeElementsVisIndex = postConflateOps.indexOf(removeElementsVisitorName);
- const int buildingOutlineOpIndex = postConflateOps.indexOf(buildingOutlineUpdateOpName);
- if (removeElementsVisIndex > buildingOutlineOpIndex)
- {
- postConflateOps.removeAll(buildingOutlineUpdateOpName);
- postConflateOps.append(buildingOutlineUpdateOpName);
- conf().set(ConfigOptions::getConflatePostOpsKey(), postConflateOps);
- }
- }
-
// This swaps the logic that removes all reviews with the logic that removes them based on score
// thresholding.
if (ConfigOptions().getAttributeConflationAllowReviewsByScore())
@@ -517,10 +495,6 @@ void ConflateCmd::_updatePostConfigOptionsForAttributeConflation()
conf().set(
ConfigOptions::getRemoveElementsVisitorElementCriteriaKey(), removeElementsCriteria);
}
-
- LOG_DEBUG(
- "Post conflate ops after Attribute Conflation adjustment: " <<
- conf().get("conflate.post.ops").toStringList());
}
}