v0.2.53..v0.2.54 changeset RemoveDuplicateWayNodesVisitor.h
Garret Voltz edited this page Mar 31, 2020
·
1 revision
diff --git a/hoot-core/src/main/cpp/hoot/core/visitors/RemoveDuplicateWayNodesVisitor.h b/hoot-core/src/main/cpp/hoot/core/visitors/RemoveDuplicateWayNodesVisitor.h
index 1cc7291..7303331 100644
--- a/hoot-core/src/main/cpp/hoot/core/visitors/RemoveDuplicateWayNodesVisitor.h
+++ b/hoot-core/src/main/cpp/hoot/core/visitors/RemoveDuplicateWayNodesVisitor.h
@@ -22,7 +22,7 @@
* This will properly maintain the copyright information. DigitalGlobe
* copyrights will be updated automatically.
*
- * @copyright Copyright (C) 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/)
+ * @copyright Copyright (C) 2018, 2019, 2020 DigitalGlobe (http://www.digitalglobe.com/)
*/
#ifndef REMOVEDUPLICATEWAYNODESVISITOR_H
@@ -30,21 +30,21 @@
// Hoot
#include <hoot/core/elements/ElementVisitor.h>
-#include <hoot/core/info/OperationStatusInfo.h>
#include <hoot/core/elements/Way.h>
+#include <hoot/core/elements/OsmMapConsumer.h>
+#include <hoot/core/elements/OsmMap.h>
namespace hoot
{
/**
- * Removes all way nodes that are duplicates, with the exception of start/end node duplicates
- * (closed ways).
+ * Removes all consecutive way nodes that are duplicates.
*
* This is kind of a bandaid for the issue discovered in #2066. The source creating the
- * duplicated nodes appears to be in the conflation routines somewhere and should be found and
- * fixed. If that happens, this visitor could be removed from the post conflation ops.
+ * duplicated nodes appears to be in the conflation routines somewhere and should eventually be
+ * found and fixed.
*/
-class RemoveDuplicateWayNodesVisitor : public ElementVisitor, public OperationStatusInfo
+class RemoveDuplicateWayNodesVisitor : public ElementVisitor, public OsmMapConsumer
{
public:
@@ -55,6 +55,11 @@ public:
virtual void visit(const ElementPtr& e);
/**
+ * @see OsmMapConsumer
+ */
+ virtual void setOsmMap(OsmMap* map) { _map = map->shared_from_this(); }
+
+ /**
* Removes duplicates nodes from a way
*
* @param way the way to remove duplicate nodes from
@@ -67,6 +72,17 @@ public:
{ return "Removed " + QString::number(_numAffected) + " duplicate way nodes"; }
virtual QString getDescription() const { return "Removes duplicate way nodes"; }
+
+ /**
+ * @see FilteredByCriteria
+ */
+ virtual QStringList getCriteria() const;
+
+ virtual std::string getClassName() const { return className(); }
+
+private:
+
+ OsmMapPtr _map;
};
}