Skip to content

v0.2.54..v0.2.55 changeset SmallHighwayMerger.cpp

Garret Voltz edited this page Aug 14, 2020 · 1 revision
diff --git a/hoot-core/src/main/cpp/hoot/core/ops/SmallHighwayMerger.cpp b/hoot-core/src/main/cpp/hoot/core/ops/SmallHighwayMerger.cpp
index 1d6341b..d60735b 100644
--- a/hoot-core/src/main/cpp/hoot/core/ops/SmallHighwayMerger.cpp
+++ b/hoot-core/src/main/cpp/hoot/core/ops/SmallHighwayMerger.cpp
@@ -53,6 +53,7 @@
 
 using namespace std;
 using namespace Tgs;
+using namespace geos::geom;
 
 namespace hoot
 {
@@ -97,14 +98,16 @@ void SmallHighwayMerger::apply(std::shared_ptr<OsmMap>& map)
 
       // if the way is smaller than the threshold, that isn't a `hoot:special` way
       if (highwayCrit.isSatisfied(w) &&
-          !w->getTags().contains(MetadataTags::HootSpecial()) &&
-          ElementConverter(map).convertToLineString(w)->getLength() <= _threshold)
+          !w->getTags().contains(MetadataTags::HootSpecial()))
       {
-        _mergeNeighbors(w);
+        std::shared_ptr<LineString> linestring = ElementConverter(map).convertToLineString(w);
+        if (linestring && linestring->getLength() <= _threshold)
+          _mergeNeighbors(w);
       }
     }
 
-    if (_numProcessed % _taskStatusUpdateInterval == 0)
+    _numProcessed++;
+    if (_numProcessed % (_taskStatusUpdateInterval * 10) == 0)
     {
       PROGRESS_INFO(
         "\tProcessed " << StringUtils::formatLargeNumber(_numProcessed) <<
Clone this wiki locally