Makes designated HOV way's routability configurable in profiles.

Why only `hov=designated` and not all access tags, such as `hov:yes`,
`hov=no` and so on? From the Wiki:

- designated: The way is designated to high occupancy vehicles.
- yes: High occupancy vehicles are allowed. This by itself does not imply that other vehicles are restricted from using the way.
- no: High occupancy vehicles are not allowed on the way. This by itself does not imply that other vehicle types are allowed to use it.

The primary use-case is conditionally filtering ways such as:

http://www.openstreetmap.org/way/11198593#map=19/37.82571/-122.30521&layers=D

In addition there is a notion of HOV lanes for lane handling:

http://wiki.openstreetmap.org/wiki/Key:hov#hov:lanes.3D.2A

This changeset does not handle lanes at all, only designated HOV ways.
For HOV lane support, a logic similar to the lane access handling needs
to be implemented. This needs to go hand in hand with the existing lane
handling introduced in:

https://github.com/Project-OSRM/osrm-backend/commit/7d076e93445a4d016422a575f1132b267cd13c29

References:
- #2711
- http://wiki.openstreetmap.org/wiki/Key:access
- http://wiki.openstreetmap.org/wiki/Key:hov#Values
This commit is contained in:
Daniel J. Hofmann
2016-07-31 18:19:50 +02:00
parent b24f5c7c1a
commit 583aaff286
3 changed files with 21 additions and 1 deletions
+7
View File
@@ -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