Skip to content

v0.2.50..v0.2.51 changeset SmallWayMerger.cpp

Garret Voltz edited this page Jan 15, 2020 · 1 revision
diff --git a/hoot-core/src/main/cpp/hoot/core/ops/SmallWayMerger.cpp b/hoot-core/src/main/cpp/hoot/core/ops/SmallWayMerger.cpp
index b0922f5..e8b5acc 100644
--- a/hoot-core/src/main/cpp/hoot/core/ops/SmallWayMerger.cpp
+++ b/hoot-core/src/main/cpp/hoot/core/ops/SmallWayMerger.cpp
@@ -132,6 +132,7 @@ void SmallWayMerger::_mergeWays(const set<long>& ids)
 
   HighwayCriterion highwayCrit(_map);
   // if either way is not a highway
+  // TODO: could we gain anything by opening this up to other linear feature types?
   if (highwayCrit.isSatisfied(w1) == false || highwayCrit.isSatisfied(w2) == false)
   {
     return;
@@ -184,10 +185,15 @@ void SmallWayMerger::_mergeWays(const set<long>& ids)
     }
     else
     {
-      LOG_TRACE("w1: " << w1->toString());
-      LOG_TRACE("w2: " << w2->toString());
-      throw HootException("The ends of the ways don't touch. "
-                          "Did you run the intersection splitter first?");
+      //throw HootException("The ends of the ways don't touch. "
+                          //"Did you run the intersection splitter first?");
+      // So far, have only seen this happen due to the UnconnectedWaySplitter connecting two roads
+      // pointing toward each other. That may need to be addressed, but regardless, don't think an
+      // exception is needed here.
+      LOG_TRACE(
+        "The ends of the ways don't touch. Skipping merge of: " << w1->getElementId() << " and " <<
+        w2->getElementId());
+      return;
     }
 
     // if the ways share both ends (circle) then this causes bad weird things to happen so
Clone this wiki locally