-
Notifications
You must be signed in to change notification settings - Fork 74
v0.2.49..v0.2.50 changeset RdpWayGeneralizerTest.cpp
Garret Voltz edited this page Nov 6, 2019
·
1 revision
diff --git a/hoot-core-test/src/test/cpp/hoot/core/algorithms/RdpWayGeneralizerTest.cpp b/hoot-core-test/src/test/cpp/hoot/core/algorithms/RdpWayGeneralizerTest.cpp
index ae2fea7..c092769 100644
--- a/hoot-core-test/src/test/cpp/hoot/core/algorithms/RdpWayGeneralizerTest.cpp
+++ b/hoot-core-test/src/test/cpp/hoot/core/algorithms/RdpWayGeneralizerTest.cpp
@@ -164,6 +164,7 @@ public:
CPPUNIT_ASSERT_EQUAL(197, inputPoints.size());
RdpWayGeneralizer generalizer(0.3);
+ generalizer.setRemoveNodesSharedByWays(true);
CPPUNIT_ASSERT_DOUBLES_EQUAL(
2.53015,
generalizer._getPerpendicularDistanceBetweenSplitNodeAndImaginaryLine(
@@ -178,6 +179,7 @@ public:
CPPUNIT_ASSERT_EQUAL(197, inputPoints.size());
RdpWayGeneralizer generalizer(0.1);
+ generalizer.setRemoveNodesSharedByWays(true);
const QList<ConstNodePtr>& outputPoints =
generalizer._getGeneralizedPoints(inputPoints);
CPPUNIT_ASSERT_EQUAL(148, outputPoints.size());
@@ -193,6 +195,7 @@ public:
CPPUNIT_ASSERT_EQUAL(197, inputPoints.size());
RdpWayGeneralizer generalizer(5.9);
+ generalizer.setRemoveNodesSharedByWays(true);
const QList<ConstNodePtr>& outputPoints =
generalizer._getGeneralizedPoints(inputPoints);
CPPUNIT_ASSERT_EQUAL(22, outputPoints.size());
@@ -208,6 +211,7 @@ public:
CPPUNIT_ASSERT_EQUAL(77, inputPoints.size());
RdpWayGeneralizer generalizer(0.1);
+ generalizer.setRemoveNodesSharedByWays(true);
const QList<ConstNodePtr>& outputPoints =
generalizer._getGeneralizedPoints(inputPoints);
CPPUNIT_ASSERT_EQUAL(48, outputPoints.size());
@@ -223,6 +227,7 @@ public:
CPPUNIT_ASSERT_EQUAL(77, inputPoints.size());
RdpWayGeneralizer generalizer(5.9);
+ generalizer.setRemoveNodesSharedByWays(true);
const QList<ConstNodePtr>& outputPoints =
generalizer._getGeneralizedPoints(inputPoints);
CPPUNIT_ASSERT_EQUAL(4, outputPoints.size());
@@ -242,10 +247,11 @@ public:
CPPUNIT_ASSERT_EQUAL((size_t)197, way->getNodeIds().size());
RdpWayGeneralizer generalizer(0.1);
+ generalizer.setRemoveNodesSharedByWays(true);
generalizer.setOsmMap(map.get());
generalizer.generalize(way);
- CPPUNIT_ASSERT_EQUAL((size_t)197, map->getNodes().size());
+ CPPUNIT_ASSERT_EQUAL((size_t)148, map->getNodes().size());
CPPUNIT_ASSERT_EQUAL((size_t)148, way->getNodeIds().size());
const QString outFile = _outputPath + "runGeneralizeWayInput1NoInformationNodesTest-out.osm";
writeMap(map, outFile);
@@ -280,10 +286,11 @@ public:
}
RdpWayGeneralizer generalizer(0.1);
+ generalizer.setRemoveNodesSharedByWays(true);
generalizer.setOsmMap(map.get());
generalizer.generalize(way);
- CPPUNIT_ASSERT_EQUAL((size_t)197, map->getNodes().size());
+ CPPUNIT_ASSERT_EQUAL((size_t)137, map->getNodes().size());
CPPUNIT_ASSERT_EQUAL((size_t)137, way->getNodeIds().size());
const QString outFile = _outputPath + "runGeneralizeWayInput1WithInformationNodesTest-out.osm";
writeMap(map, outFile);
@@ -305,7 +312,6 @@ public:
QString("Invalid epsilon value: 0").toStdString(),
exceptionMsg.toStdString());
}
-
};
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(RdpWayGeneralizerTest, "quick");