From 5190ea1afcf0b5a6fd3fa5b72d23bd8266091ddd Mon Sep 17 00:00:00 2001 From: "Daniel J. Hofmann" Date: Wed, 2 Sep 2015 12:03:07 +0200 Subject: [PATCH 1/2] Make pedestrian roads marked as destination routable with car profile. Check provided tests with: cucumber --tags @access -p verify References: - /~https://github.com/Project-OSRM/osrm-backend/issues/1617 - http://wiki.openstreetmap.org/wiki/Tag:highway%3Dpedestrian - http://wiki.openstreetmap.org/wiki/Key:motorcar - http://wiki.openstreetmap.org/wiki/Key:access --- features/car/access.feature | 16 +++++++++------- profiles/car.lua | 6 +++++- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/features/car/access.feature b/features/car/access.feature index 5fd56f39515..8f05ccbcad6 100644 --- a/features/car/access.feature +++ b/features/car/access.feature @@ -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 diff --git a/profiles/car.lua b/profiles/car.lua index 03ca924dc97..42cd50a2cc3 100644 --- a/profiles/car.lua +++ b/profiles/car.lua @@ -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 result.forward_speed = speed_profile["default"] result.backward_speed = speed_profile["default"] end From 866fde231380361e247fa69a6b4fe4667623d3d1 Mon Sep 17 00:00:00 2001 From: "Daniel J. Hofmann" Date: Thu, 3 Sep 2015 11:15:03 +0200 Subject: [PATCH 2/2] Move destination to access tag white list instead of making exception in car profile. Tested with: cucumber --tags @access -p verify References: - /~https://github.com/Project-OSRM/osrm-backend/issues/1617 - /~https://github.com/Project-OSRM/osrm-backend/pull/1639 --- profiles/car.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/profiles/car.lua b/profiles/car.lua index 42cd50a2cc3..d5107324682 100644 --- a/profiles/car.lua +++ b/profiles/car.lua @@ -4,7 +4,7 @@ local find_access_tag = require("lib/access").find_access_tag -- Begin of globals barrier_whitelist = { ["cattle_grid"] = true, ["border_control"] = true, ["checkpoint"] = true, ["toll_booth"] = true, ["sally_port"] = true, ["gate"] = true, ["lift_gate"] = true, ["no"] = true, ["entrance"] = true } -access_tag_whitelist = { ["yes"] = true, ["motorcar"] = true, ["motor_vehicle"] = true, ["vehicle"] = true, ["permissive"] = true, ["designated"] = true } +access_tag_whitelist = { ["yes"] = true, ["motorcar"] = true, ["motor_vehicle"] = true, ["vehicle"] = true, ["permissive"] = true, ["designated"] = true, ["destination"] = true } access_tag_blacklist = { ["no"] = true, ["private"] = true, ["agricultural"] = true, ["forestry"] = true, ["emergency"] = true, ["psv"] = true } access_tag_restricted = { ["destination"] = true, ["delivery"] = true } access_tags = { "motorcar", "motor_vehicle", "vehicle" } @@ -297,12 +297,8 @@ 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] or pedestrian_road then + if access_tag_whitelist[access] then result.forward_speed = speed_profile["default"] result.backward_speed = speed_profile["default"] end