Skip to content

Commit

Permalink
In the OSRMGeoFilter, if the first euclidean pass did not return any …
Browse files Browse the repository at this point in the history
…node, don't request data from OSRM

OSRM would return no results as at best it can do the euclidean distance.

Closes: chairemobilite#264
  • Loading branch information
greenscientist committed Nov 27, 2023
1 parent dae309b commit 2e1fd30
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/osrmgeofilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2e1fd30

Please sign in to comment.