diff --git a/features/car/access.feature b/features/car/access.feature index 93691d4d0..4e614a600 100644 --- a/features/car/access.feature +++ b/features/car/access.feature @@ -5,7 +5,7 @@ Feature: Car - Restricted access Background: Given the profile "car" - Scenario: Car - Access tag hierarchy on ways + Scenario: Car - Access tag hierarchy on ways Then routability should be | access | vehicle | motor_vehicle | motorcar | bothw | | | | | | x | @@ -148,3 +148,10 @@ Feature: Car - Restricted access | primary | | | no | | x | | runway | | | | yes | | | primary | | | | no | x | + + Scenario: Car - only designated HOV ways are ignored by default + Then routability should be + | highway | hov | bothw | + | primary | designated | | + | primary | yes | x | + | primary | no | x | diff --git a/profiles/car.lua b/profiles/car.lua index c2f66e2e3..c5c57291c 100644 --- a/profiles/car.lua +++ b/profiles/car.lua @@ -148,6 +148,7 @@ local turn_bias = 1.2 local obey_oneway = true local ignore_areas = true +local ignore_hov_ways = true local abs = math.abs local min = math.min @@ -233,6 +234,12 @@ function way_function (way, result) return end + -- respect user-preference for HOV-only ways + local hov = way:get_value_by_key("hov") + if ignore_hov_ways and hov and "designated" == hov 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 bc1883777..2760a6fc9 100644 --- a/taginfo.json +++ b/taginfo.json @@ -46,6 +46,12 @@ "object_types": [ "way" ], "description": "Roads with area=yes are ignored by default." }, + { + "key": "hov", + "value": "designated", + "object_types": [ "way" ], + "description": "Roads with hov=designated are ignored by default." + }, { "key": "impassable", "description": "This is used by HOT."