Route over alternating oneways but not reversible ones, closes #2837.
- alternating: high frequency, route over them with penalty - reversible: low frequency, do not route over them - time dependence - http://wiki.openstreetmap.org/wiki/Tag:oneway%3Dreversible - http://wiki.openstreetmap.org/wiki/Tag:oneway%3Dalternating This distinction was made at the Elbe-Labe Meetup in Dresden, with accompanying Wiki pages and tagging scheme. Thanks all involed! - https://github.com/Project-OSRM/osrm-backend/issues/2837 - http://wiki.openstreetmap.org/wiki/Key:oneway
This commit is contained in:
parent
6cf99c886f
commit
a13cf3f2be
@ -3,6 +3,7 @@
|
||||
- Profiles
|
||||
- `restrictions` is now used for namespaced restrictions and restriction exceptions (e.g. `restriction:motorcar=` as well as `except=motorcar`)
|
||||
- replaced lhs/rhs profiles by using test defined profiles
|
||||
- Handle `oneway=alternating` (routed over with penalty) separately from `oneway=reversible` (not routed over due to time dependence)
|
||||
- Guidance
|
||||
- Notifications are now exposed more prominently, announcing turns onto a ferry/pushing your bike more prominently
|
||||
- Trip Plugin
|
||||
|
@ -85,3 +85,12 @@ Feature: Car - Oneway streets
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | c | ab,bc,bc |
|
||||
|
||||
|
||||
# Reversible oneways (low frequency) vs alternating oneways (high frequency).
|
||||
# See: https://github.com/Project-OSRM/osrm-backend/issues/2837
|
||||
Scenario: Car - Route over alternating but not reversible oneways
|
||||
Then routability should be
|
||||
| highway | oneway | forw | backw |
|
||||
| primary | reversible | | |
|
||||
| primary | alternating | x | x |
|
||||
|
@ -22,3 +22,16 @@ Feature: Car - speeds
|
||||
| residential | no | 31 km/h |
|
||||
| living_street | no | 18 km/h |
|
||||
| service | no | 23 km/h |
|
||||
|
||||
# Alternating oneways have to take average waiting time into account.
|
||||
Scenario: Car - scaled speeds for oneway=alternating
|
||||
Then routability should be
|
||||
| highway | oneway | junction | bothw | # |
|
||||
| tertiary | | | 43 km/h | |
|
||||
| tertiary | alternating | | 20 km/h +- 5 | |
|
||||
| motorway | | | 82 km/h | implied oneway |
|
||||
| motorway | alternating | | 30 km/h +- 5 | implied oneway |
|
||||
| motorway | reversible | | | unroutable |
|
||||
| primary | | roundabout | 63 km/h | implied oneway |
|
||||
| primary | alternating | roundabout | 25 km/h +- 5 | implied oneway |
|
||||
| primary | reversible | roundabout | | unroutable |
|
||||
|
@ -308,7 +308,9 @@ function way_function (way, result)
|
||||
return
|
||||
end
|
||||
|
||||
-- check if oneway tag is unsupported
|
||||
-- Reversible oneways change direction with low frequency (think twice a day):
|
||||
-- do not route over these at all at the moment because of time dependence.
|
||||
-- Note: alternating (high frequency) oneways are handled below with penalty.
|
||||
local oneway = way:get_value_by_key("oneway")
|
||||
if oneway and "reversible" == oneway then
|
||||
return
|
||||
@ -584,6 +586,18 @@ function way_function (way, result)
|
||||
result.backward_speed = math.min(penalized_speed, scaled_speed)
|
||||
end
|
||||
|
||||
-- Handle high frequency reversible oneways (think traffic signal controlled, changing direction every 15 minutes).
|
||||
-- Scaling speed to take average waiting time into account plus some more for start / stop.
|
||||
if oneway and "alternating" == oneway then
|
||||
local scaling_factor = 0.4
|
||||
if result.forward_speed ~= math.huge then
|
||||
result.forward_speed = result.forward_speed * scaling_factor
|
||||
end
|
||||
if result.backward_speed ~= math.huge then
|
||||
result.backward_speed = result.backward_speed * scaling_factor
|
||||
end
|
||||
end
|
||||
|
||||
-- only allow this road as start point if it not a ferry
|
||||
result.is_startpoint = result.forward_mode == mode.driving or result.backward_mode == mode.driving
|
||||
end
|
||||
|
@ -44,10 +44,16 @@
|
||||
"value": "-1",
|
||||
"object_types": [ "way" ]
|
||||
},
|
||||
{
|
||||
"key": "oneway",
|
||||
"value": "alternating",
|
||||
"description": "high frequency reversible oneways are routed over taking the waiting period into account",
|
||||
"object_types": [ "way" ]
|
||||
},
|
||||
{
|
||||
"key": "oneway",
|
||||
"value": "reversible",
|
||||
"description": "is marked as non-routable because of time-dependence",
|
||||
"description": "low frequency reversible oneways are marked as non-routable because of time-dependence",
|
||||
"object_types": [ "way" ]
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user