Skip to content

v0.2.48..v0.2.49 changeset PoiPolygonReviewReducer.cpp

Garret Voltz edited this page Oct 2, 2019 · 1 revision
diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonReviewReducer.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonReviewReducer.cpp
index e8583ef..e0a5e19 100644
--- a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonReviewReducer.cpp
+++ b/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonReviewReducer.cpp
@@ -703,16 +703,20 @@ bool PoiPolygonReviewReducer::_poiNeighborIsCloserToPolyThanPoi(ConstElementPtr
         {
           LOG_VART(poi);
           LOG_VART(poiNeighbor);
+          //  This only handles ways as polygons and not relations
           ConstWayPtr polyWay = std::dynamic_pointer_cast<const Way>(poly);
+          if (polyWay)
+          {
             std::shared_ptr<const LineString> polyLineStr =
               std::dynamic_pointer_cast<const LineString>(
                 ElementConverter(_map).convertToLineString(polyWay));
-          const long neighborPoiToPolyDist = polyLineStr->distance(poiNeighborGeom.get());
-          LOG_VART(neighborPoiToPolyDist);
-          if (_distance > neighborPoiToPolyDist)
-          {
-            LOG_TRACE("Returning miss per review reduction rule #25a...");
-            return true;
+            const long neighborPoiToPolyDist = polyLineStr->distance(poiNeighborGeom.get());
+            LOG_VART(neighborPoiToPolyDist);
+            if (_distance > neighborPoiToPolyDist)
+            {
+              LOG_TRACE("Returning miss per review reduction rule #25a...");
+              return true;
+            }
           }
         }
       }
Clone this wiki locally