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

Make pedestrian roads marked as destination routable with car profile. #1639

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
16 changes: 9 additions & 7 deletions features/car/access.feature
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,15 @@ Feature: Car - Restricted access

Scenario: Car - Access combinations
Then routability should be
| highway | accesss | vehicle | motor_vehicle | motorcar | bothw |
| runway | private | | | permissive | x |
| primary | forestry | | yes | | x |
| cycleway | | | designated | | x |
| residential | | yes | no | | |
| motorway | yes | permissive | | private | |
| trunk | agricultural | designated | permissive | no | |
| highway | accesss | vehicle | motor_vehicle | motorcar | bothw |
| runway | private | | | permissive | x |
| primary | forestry | | yes | | x |
| cycleway | | | designated | | x |
| residential | | yes | no | | |
| motorway | yes | permissive | | private | |
| trunk | agricultural | designated | permissive | no | |
| pedestrian | | | | | |
| pedestrian | | | | destination | x |

Scenario: Car - Ignore access tags for other modes
Then routability should be
Expand Down
6 changes: 5 additions & 1 deletion profiles/car.lua
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,12 @@ function way_function (way, result)
result.backward_speed = highway_speed
end
else
-- make an exception for restricted highway=pedestrian with motorcar=destination
local motorcar = way:get_value_by_key("motorcar")
local pedestrian_road = motorcar and "destination" == motorcar and "pedestrian" == highway

-- Set the avg speed on ways that are marked accessible
if access_tag_whitelist[access] then
if access_tag_whitelist[access] or pedestrian_road then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is fine to add this to access_tag_whitelist.

result.forward_speed = speed_profile["default"]
result.backward_speed = speed_profile["default"]
end
Expand Down