Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Select max_duration by StreetNetworkPathType #4285

Merged
merged 2 commits into from
Jul 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading