Skip to content

Commit

Permalink
Merge pull request #4285 from hove-io/nav_2957
Browse files Browse the repository at this point in the history
Fix: Select max_duration by StreetNetworkPathType
  • Loading branch information
xlqian authored Jul 30, 2024
2 parents ddefe9d + 8a6130b commit da4b05f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions source/jormungandr/jormungandr/street_network/asgard.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,10 +429,14 @@ def _direct_path(
# bigger than max_{mode}_direct_path_distance don't compute direct_path
if crowfly_distance > int(request['max_{mode}_direct_path_distance'.format(mode=mode)]):
return response_pb2.Response()

max_duration_param_name = (
'max_{mode}_direct_path_duration'.format(mode=mode)
if direct_path_type == StreetNetworkPathType.DIRECT
else 'max_{mode}_duration_to_pt'.format(mode=mode)
)
if (
crowfly_distance / float(request['{mode}_speed'.format(mode=mode)])
> request['max_{mode}_direct_path_duration'.format(mode=mode)]
> request[max_duration_param_name]
):
return response_pb2.Response()

Expand Down

0 comments on commit da4b05f

Please sign in to comment.