From 2e1fd304d0d5cc9f71071eb1152761184027965d Mon Sep 17 00:00:00 2001 From: Yannick Brosseau Date: Sat, 25 Nov 2023 10:02:46 -0500 Subject: [PATCH] In the OSRMGeoFilter, if the first euclidean pass did not return any node, don't request data from OSRM OSRM would return no results as at best it can do the euclidean distance. Closes: #264 --- src/osrmgeofilter.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/osrmgeofilter.cpp b/src/osrmgeofilter.cpp index 94bcca1..5566e02 100644 --- a/src/osrmgeofilter.cpp +++ b/src/osrmgeofilter.cpp @@ -45,6 +45,14 @@ namespace TrRouting { } } + // If we don't have any node accessible with the euclidean distance, don't bother calculating + // the exact distance with OSRM + if (birdDistanceAccessibleNodeIndexes.size() == 0) { + // Return the empty vector + spdlog::debug("There was no node potentially accessible, we did not ask OSRM"); + return accessibleNodesFootpaths; + } + queryString += "?annotations=duration,distance"; if (reversed)