diff --git a/features/car/access.feature b/features/car/access.feature index 4e614a600..3cf79975d 100644 --- a/features/car/access.feature +++ b/features/car/access.feature @@ -155,3 +155,10 @@ Feature: Car - Restricted access | primary | designated | | | primary | yes | x | | primary | no | x | + + Scenario: Car - only toll=yes ways are ignored by default + Then routability should be + | highway | toll | bothw | + | primary | yes | | + | primary | no | x | + | primary | snowmobile | x | diff --git a/profiles/car.lua b/profiles/car.lua index c5c57291c..28fc9df84 100644 --- a/profiles/car.lua +++ b/profiles/car.lua @@ -149,6 +149,7 @@ local turn_bias = 1.2 local obey_oneway = true local ignore_areas = true local ignore_hov_ways = true +local ignore_toll_ways = true local abs = math.abs local min = math.min @@ -240,6 +241,12 @@ function way_function (way, result) return end + -- respect user-preference for toll=yes ways + local toll = way:get_value_by_key("toll") + if ignore_toll_ways and toll and "yes" == toll then + return + end + -- check if oneway tag is unsupported local oneway = way:get_value_by_key("oneway") if oneway and "reversible" == oneway then diff --git a/taginfo.json b/taginfo.json index 2760a6fc9..b8168379e 100644 --- a/taginfo.json +++ b/taginfo.json @@ -52,6 +52,12 @@ "object_types": [ "way" ], "description": "Roads with hov=designated are ignored by default." }, + { + "key": "toll", + "value": "yes", + "object_types": [ "way" ], + "description": "Roads with toll=yes are ignored by default." + }, { "key": "impassable", "description": "This is used by HOT."