don't assign lanes on delayed turns

This commit is contained in:
Moritz Kobitzsch 2016-07-08 11:45:36 +02:00
parent af47252efe
commit b6dbf81206
12 changed files with 265 additions and 157 deletions

View File

@ -5,9 +5,7 @@ Feature: Turn Lane Guidance
Given the profile "car" Given the profile "car"
Given a grid size of 3 meters Given a grid size of 3 meters
#requires https://github.com/cucumber/cucumber-js/issues/417 @sliproads
#Due to this, we use & as a pipe character. Switch them out for \| when 417 is fixed
@bug @WORKAROUND-FIXME
Scenario: Separate Turn Lanes Scenario: Separate Turn Lanes
Given the node map Given the node map
| | | | | | | | e | | | | | | | | | | e | |
@ -36,86 +34,7 @@ Feature: Turn Lane Guidance
| a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true right:false, | | a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true right:false, |
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, | | a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
@TODO @2650 @bug @sliproads
Scenario: Sliproad with through lane
Given the node map
| | | | | | | | | | f | | | |
| | | | | | | | | | | | | |
| | | | | | | | g | | | | | |
| | | | | | | | | | | | | |
| | | | | | | | | | | | | e |
| | | | | | | | | | | | | |
| | | | | | | | | | d | | | |
| a | | | | | | | | | | | | |
| | | | | | b | | | | | | | |
| | | | | | | | | | c | | | |
| | | | | | | | | | | | | |
| | | | | | | | | | | | | |
| | | | | h | | | | | i | | | |
And the ways
| nodes | name | oneway | turn:lanes:forward |
| ab | ghough | yes | |
| bc | ghough | yes | through\|none |
| bd | ghough | yes | none\|through |
| de | ghough | yes | |
| fgb | haight | yes | |
| bh | haight | yes | left\|none |
| fd | market | yes | |
| dc | market | yes | |
| ci | market | yes | |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | fgb | bd | b | no_left_turn |
| restriction | fgb | bc | b | no_left_turn |
When I route I should get
| waypoints | route | turns | lanes |
| a,h | ghough,haight,haight | depart,turn right,arrive | |
| a,i | ghough,market,market | depart,turn right,arrive | |
| a,e | ghough,ghough,ghough | depart,continue slight left,arrive | |
@TODO @2650 @bug
Scenario: Sliproad with through lane
Given the node map
| | | | | | | | f | | |
| | | | | | | | | | |
| | | | | | | g | | | |
| | | | | | | | | | |
| | | | | | | | | | e |
| | | | | | | | | | |
| | | | | | | | d | | |
| a | | | | | | | | | |
| | | | | b | | | | | |
| | | | | | | | c | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | h | | | | i | | |
And the ways
| nodes | name | oneway | turn:lanes:forward |
| ab | ghough | yes | |
| bc | ghough | yes | through\|none |
| bd | ghough | yes | none\|through |
| fgb | haight | yes | |
| bh | haight | yes | left\|none |
| fd | market | yes | |
| dc | market | yes | |
| ci | market | yes | |
And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | bd | dc | d | no_right_turn |
| restriction | fgb | bd | b | no_left_turn |
| restriction | fgb | bc | b | no_left_turn |
When I route I should get
| waypoints | route | turns | lanes |
| a,h | ghough,haight,haight | depart,turn right,arrive | |
| a,i | ghough,market,market | depart,turn right,arrive | |
| a,e | ghough,ghough,ghough | depart,continue slight left,arrive | |
Scenario: Separate Turn Lanes Scenario: Separate Turn Lanes
Given the node map Given the node map
| | | | | | | | e | | | | | | | | | | e | |
@ -144,7 +63,7 @@ Feature: Turn Lane Guidance
| a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true right:false, | | a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true right:false, |
| a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, | | a,f | in,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
@guidance @lanes @sliproads @sliproads
Scenario: Separate Turn Lanes Next to other turns Scenario: Separate Turn Lanes Next to other turns
Given the node map Given the node map
| | | | | | | | e | | | | | | | | | | e | |
@ -184,3 +103,166 @@ Feature: Turn Lane Guidance
| a,j | in,turn,other,other | depart,turn right,turn left,arrive | ,,left:true right:false, | | a,j | in,turn,other,other | depart,turn right,turn left,arrive | ,,left:true right:false, |
| a,i | in,turn,other,other | depart,turn right,turn right,arrive | ,,left:false right:true, | | a,i | in,turn,other,other | depart,turn right,turn right,arrive | ,,left:false right:true, |
@todo @bug @2654 @none
#https://github.com/Project-OSRM/osrm-backend/issues/2645
#http://www.openstreetmap.org/export#map=19/52.56054/13.32152
Scenario: Kurt-Schuhmacher-Damm
Given the node map
| | | | g | | f |
| | | | | | |
| j | | | h | | e |
| | | | | | |
| a | | | b | | c |
| | | | i | | d |
And the ways
| nodes | name | highway | oneway | turn:lanes |
| ab | | motorway_link | yes | left\|none\|right |
| bc | | primary_link | yes | |
| cd | ksd | secondary | yes | |
| cef | ksd | primary | yes | |
| hj | | motorway_link | yes | |
| eh | | secondary_link | yes | |
| gh | ksd | primary | yes | |
| hbi | ksd | secondary | yes | |
When I route I should get
| waypoints | route | turns | lanes |
| a,f | ,ksd,ksd | depart,turn left,arrive | ,left:true none:true right:false, |
| a,i | ,ksd,ksd | depart,turn right,arrive | ,left:false none:true right:true, |
@todo @bug @2650 @sliproads
#market and haight in SF
#http://www.openstreetmap.org/#map=19/37.77308/-122.42238
Scenario: Through Street Crossing Mid-Turn
Given the node map
| | | | | | | | g | j | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | k | | | | |
| | | | | | | | | | |
| | | | | | | | | | f |
| | | | | | | | | e | |
| | | | | | | | d | | |
| | | | | | | | | | |
| a | | | b | | | | | | |
| | | | | | | | c | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | l | | | | | h | i | |
And the ways
| nodes | name | highway | oneway | turn:lanes:forward |
| ab | ghough | secondary | yes | |
| bc | ghough | secondary | yes | through\|through |
| bd | ghough | secondary | yes | none\|through |
| def | ghough | secondary | yes | |
| gd | market | primary | yes | |
| dc | market | primary | yes | |
| ch | market | primary | yes | |
| iej | market | primary | yes | |
| gkb | haight | residential | yes | |
| bl | haight | residential | yes | left\|none |
And the relations
| type | way:from | way:to | node:via | restriction |
| relation | bd | dc | d | no_right_turn |
When I route I should get
| waypoints | route | turns | lanes |
| a,l | ghough,haight,haight | depart,turn right,arrive | ,none:false straight:false straight:false straight:true, |
| a,h | ghough,market,market | depart,turn slight right,arrive | ,none:false straight:false straight:true straight:true, |
| a,j | ghough,market,market | depart,turn left,arrive | ,none:true straight:false straight:false straight:false, |
| a,f | ghough,ghough,ghough | depart,continue slight left,arrive | ,none:true straight:true straight:false straight:false, |
@todo @bug @2650 @sliproads
#market and haight in SF
#http://www.openstreetmap.org/#map=19/37.77308/-122.42238
Scenario: Market/Haight without Through Street
Given the node map
| | | | | | | | g | j | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | f |
| | | | | | | | | e | |
| | | | | | | | d | | |
| a | | | | | | b | c | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | l | | | h | i | |
And the ways
| nodes | name | highway | oneway | turn:lanes:forward |
| ab | ghough | secondary | yes | |
| bc | ghough | secondary | yes | through\|through |
| bd | ghough | secondary | yes | none\|through |
| def | ghough | secondary | yes | |
| gd | market | primary | yes | |
| dc | market | primary | yes | |
| ch | market | primary | yes | |
| iej | market | primary | yes | |
| bl | haight | residential | yes | left\|none |
And the relations
| type | way:from | way:to | node:via | restriction |
| relation | bd | dc | d | no_right_turn |
When I route I should get
| waypoints | route | turns | lanes |
| a,l | ghough,haight,haight | depart,turn right,arrive | ,none:false straight:false straight:false straight:true, |
| a,h | ghough,market,market | depart,turn slight right,arrive | ,none:false straight:false straight:true straight:true, |
| a,j | ghough,market,market | depart,turn left,arrive | ,none:true straight:false straight:false straight:false, |
| a,f | ghough,ghough,ghough | depart,continue slight left,arrive | ,none:true straight:true straight:false straight:false, |
@todo @2650 @bug @sliproads
#market and haight in SF
#http://www.openstreetmap.org/#map=19/37.77308/-122.42238
Scenario: Market/Haight without Through Street
Given the node map
| | | | | | | | g | j | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | f |
| | | | | | | | | e | |
| | | | | | | | d | | |
| a | | | | | | b | c | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | l | | | h | i | |
And the ways
| nodes | name | highway | oneway | turn:lanes:forward |
| ab | ghough | secondary | yes | |
| bc | ghough | secondary | yes | through\|through |
| bd | ghough | secondary | yes | none\|through |
| def | ghough | secondary | yes | |
| gd | market | primary | yes | |
| dc | market | primary | yes | |
| ch | market | primary | yes | |
| iej | market | primary | yes | |
| bl | haight | residential | yes | left\|none |
When I route I should get
| waypoints | route | turns | lanes |
| a,l | ghough,haight,haight | depart,turn right,arrive | ,none:false straight:false straight:false straight:true, |
| a,h | ghough,market,market | depart,turn slight right,arrive | ,none:false straight:false straight:true straight:true, |
| a,j | ghough,market,market | depart,turn left,arrive | ,none:true straight:false straight:false straight:false, |
| a,f | ghough,ghough,ghough | depart,continue slight left,arrive | ,none:true straight:true straight:false straight:false, |

View File

@ -463,18 +463,18 @@ Feature: Turn Lane Guidance
| | y | | | | | | y | | | |
And the ways And the ways
| nodes | turn:lanes:forward | highway | junction | name | | nodes | turn:lanes:forward | highway | junction | name |
| ab | through\|right\|right\|right\|right | primary | | abx | | ab | through\|right\|right\|right\|right | primary | | abx |
| bx | | primary | | abx | | bx | | primary | | abx |
| bc | right\|right\|right\|right | primary | | bc | | bc | right\|right\|right\|right | primary | | bc |
| cd | | primary | roundabout | cdefc | | cd | | primary | roundabout | cdefc |
| de | slight_left\|slight_left&slight_left\|slight_right | primary | roundabout | cdefc | | de | slight_left\|slight_left\|slight_left\|slight_right | primary | roundabout | cdefc |
| ef | left\|slight_right\|slight_right | primary | roundabout | cdefc | | ef | left\|slight_right\|slight_right | primary | roundabout | cdefc |
| fc | | primary | roundabout | cdefc | | fc | | primary | roundabout | cdefc |
| ey | | primary | | ey | | ey | | primary | | ey |
| fg | through\|right | primary | | fg | | fg | through\|right | primary | | fg |
| gz | | primary | | gz | | gz | | primary | | gz |
| gh | | primary | | gh | | gh | | primary | | gh |
When I route I should get When I route I should get
| waypoints | route | turns | lanes | | waypoints | route | turns | lanes |

View File

@ -756,15 +756,15 @@ Feature: Collapse
| | | | h | i | | | | | | h | i | |
And the ways And the ways
| nodes | turn:lanes:forward | name | | nodes | turn:lanes:forward | name |
| ab | | main | | ab | | main |
| bc | left\|through&through&through&right | main | | bc | left\|through\|through\|through\|right | main |
| cd | left\|through&right | main | | cd | left\|through\|right | main |
| de | | main | | de | | main |
| cf | | off | | cf | | off |
| ch | | off | | ch | | off |
| dg | | off | | dg | | off |
| di | | off | | di | | off |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
@ -779,15 +779,15 @@ Feature: Collapse
| | | | h | i | | | | | | h | i | |
And the ways And the ways
| nodes | turn:lanes:forward | name | | nodes | turn:lanes:forward | name |
| ab | | main | | ab | | main |
| bc | left\|through&through&through&right | main | | bc | left\|through\|through\|through\|right | main |
| cd | left\|through&through&through&right | main | | cd | left\|through\|through\|through\|right | main |
| de | | main | | de | | main |
| cf | | off | | cf | | off |
| ch | | off | | ch | | off |
| dg | | off | | dg | | off |
| di | | off | | di | | off |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |

View File

@ -5,7 +5,7 @@ Feature: Turn Lane Guidance
Given the profile "car" Given the profile "car"
Given a grid size of 20 meters Given a grid size of 20 meters
@bug @simple
Scenario: Basic Turn Lane 3-way Turn with empty lanes Scenario: Basic Turn Lane 3-way Turn with empty lanes
Given the node map Given the node map
| a | | b | | c | | a | | b | | c |
@ -40,6 +40,7 @@ Feature: Turn Lane Guidance
| a,c | in,straight,straight | depart,new name straight,arrive | ,straight:true right:false, | | a,c | in,straight,straight | depart,new name straight,arrive | ,straight:true right:false, |
| a,d | in,right,right | depart,turn right,arrive | ,straight:false right:true, | | a,d | in,right,right | depart,turn right,arrive | ,straight:false right:true, |
@simple
Scenario: Basic Turn Lane 4-Way Turn Scenario: Basic Turn Lane 4-Way Turn
Given the node map Given the node map
| | | e | | | | | | e | | |
@ -62,6 +63,7 @@ Feature: Turn Lane Guidance
| d,e | right,left,left | depart,new name straight,arrive | ,left:false none:true, | | d,e | right,left,left | depart,new name straight,arrive | ,left:false none:true, |
| d,c | right,straight,straight | depart,turn right,arrive | ,left:false none:true, | | d,c | right,straight,straight | depart,turn right,arrive | ,left:false none:true, |
@simple @none
Scenario: Basic Turn Lane 4-Way Turn using none Scenario: Basic Turn Lane 4-Way Turn using none
Given the node map Given the node map
| | | e | | | | | | e | | |
@ -81,6 +83,7 @@ Feature: Turn Lane Guidance
| a,d | in,right,right | depart,turn right,arrive | ,none:false right:true, | | a,d | in,right,right | depart,turn right,arrive | ,none:false right:true, |
| a,e | in,left,left | depart,turn left,arrive | ,none:true right:false, | | a,e | in,left,left | depart,turn left,arrive | ,none:true right:false, |
@simple @reverse
Scenario: Basic Turn Lane 4-Way With U-Turn Lane Scenario: Basic Turn Lane 4-Way With U-Turn Lane
Given the node map Given the node map
| | | e | | | | | | e | | |
@ -103,6 +106,7 @@ Feature: Turn Lane Guidance
#this next test requires decision on how to announce lanes for going straight if there is no turn #this next test requires decision on how to announce lanes for going straight if there is no turn
@simple @psv @none
Scenario: Turn with Bus-Lane Scenario: Turn with Bus-Lane
Given the node map Given the node map
| a | | b | | c | | a | | b | | c |
@ -158,7 +162,7 @@ Feature: Turn Lane Guidance
| waypoints | route | turns | lanes | | waypoints | route | turns | lanes |
| a,d | road,turn,turn | depart,turn right,arrive | ,straight:false right:true, | | a,d | road,turn,turn | depart,turn right,arrive | ,straight:false right:true, |
@PROFILE @LANES @simple @psv
Scenario: Turn with Bus-Lane but without lanes Scenario: Turn with Bus-Lane but without lanes
Given the node map Given the node map
| a | | b | | c | | a | | b | | c |
@ -177,7 +181,7 @@ Feature: Turn Lane Guidance
| a,c | road,road | depart,arrive | | a,c | road,road | depart,arrive |
#turn lanes are often drawn at the incoming road, even though the actual turn requires crossing the intersection first #turn lanes are often drawn at the incoming road, even though the actual turn requires crossing the intersection first
@todo @bug @todo @bug @collapse @partition-lanes
Scenario: Turn Lanes at Segregated Road Scenario: Turn Lanes at Segregated Road
Given the node map Given the node map
| | | i | l | | | | | | i | l | | |
@ -222,6 +226,7 @@ Feature: Turn Lane Guidance
| i,l | cross,cross,cross | depart,continue uturn,arrive | ,left:true straight:false, | | i,l | cross,cross,cross | depart,continue uturn,arrive | ,left:true straight:false, |
#copy of former case to prevent further regression #copy of former case to prevent further regression
@collapse @partition-lanes
Scenario: Turn Lanes at Segregated Road Scenario: Turn Lanes at Segregated Road
Given the node map Given the node map
| | | i | l | | | | | | i | l | | |
@ -255,6 +260,7 @@ Feature: Turn Lane Guidance
| i,j | cross,cross | depart,arrive | , | | i,j | cross,cross | depart,arrive | , |
| i,l | cross,cross,cross | depart,continue uturn,arrive | ,left:true straight:false, | | i,l | cross,cross,cross | depart,continue uturn,arrive | ,left:true straight:false, |
@partition-lanes
Scenario: Turn Lanes at Segregated Road Scenario: Turn Lanes at Segregated Road
Given the node map Given the node map
| | | g | f | | | | | | g | f | | |
@ -277,7 +283,7 @@ Feature: Turn Lane Guidance
| a,j | road,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, | | a,j | road,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
#this can happen due to traffic lights / lanes not drawn up to the intersection itself #this can happen due to traffic lights / lanes not drawn up to the intersection itself
@2654 @2654 @previous-lanes
Scenario: Turn Lanes Given earlier than actual turn Scenario: Turn Lanes Given earlier than actual turn
Given the node map Given the node map
| a | | b | c | | d | | a | | b | c | | d |
@ -296,7 +302,7 @@ Feature: Turn Lane Guidance
| a,e | road,turn,turn | depart,turn right,arrive | ,none:false right:true, | | a,e | road,turn,turn | depart,turn right,arrive | ,none:false right:true, |
| a,d | road,road | depart,arrive | , | | a,d | road,road | depart,arrive | , |
@2654 @2654 @previous-lanes
Scenario: Turn Lanes Given earlier than actual turn Scenario: Turn Lanes Given earlier than actual turn
Given the node map Given the node map
| a | | b | c | d | | e | | f | g | h | | i | | a | | b | c | d | | e | | f | g | h | | i |
@ -319,6 +325,7 @@ Feature: Turn Lane Guidance
| i,j | road,first-turn,first-turn | depart,turn left,arrive | ,left:true none:false, | | i,j | road,first-turn,first-turn | depart,turn left,arrive | ,left:true none:false, |
| i,a | road,road | depart,arrive | , | | i,a | road,road | depart,arrive | , |
@previous-lanes
Scenario: Passing a one-way street Scenario: Passing a one-way street
Given the node map Given the node map
| e | | | f | | | e | | | f | |
@ -335,6 +342,7 @@ Feature: Turn Lane Guidance
| waypoints | route | turns | lanes | | waypoints | route | turns | lanes |
| a,f | road,turn,turn | depart,turn left,arrive | ,left:true straight:false, | | a,f | road,turn,turn | depart,turn left,arrive | ,left:true straight:false, |
@partition-lanes
Scenario: Passing a one-way street, partly pulled back lanes Scenario: Passing a one-way street, partly pulled back lanes
Given the node map Given the node map
| e | | | f | | | e | | | f | |
@ -350,10 +358,12 @@ Feature: Turn Lane Guidance
| bg | right | | no | | bg | right | | no |
When I route I should get When I route I should get
| waypoints | route | turns | lanes | | waypoints | route | turns | lanes |
| a,f | road,turn,turn | depart,turn left,arrive | ,left:true straight;right:false, | | a,f | road,turn,turn | depart,turn left,arrive | ,left:true straight;right:false, |
| a,g | road,right,right | depart,turn right,arrive | ,left:false straight;right:true, | | a,d | road,road,road | depart,use lane straight,arrive | ,left:false straight;right:true, |
| a,g | road,right,right | depart,turn right,arrive | ,left:false straight;right:true, |
@partition-lanes @previous-lanes
Scenario: Passing a one-way street, partly pulled back lanes, no through Scenario: Passing a one-way street, partly pulled back lanes, no through
Given the node map Given the node map
| e | | | f | | e | | | f |
@ -373,7 +383,7 @@ Feature: Turn Lane Guidance
| a,f | road,turn,turn | depart,turn left,arrive | ,left:true right:false, | | a,f | road,turn,turn | depart,turn left,arrive | ,left:true right:false, |
| a,g | road,right,right | depart,turn right,arrive | ,left:false right:true, | | a,g | road,right,right | depart,turn right,arrive | ,left:false right:true, |
@todo @bug @todo @bug @partition-lanes @previous-lanes
Scenario: Narrowing Turn Lanes Scenario: Narrowing Turn Lanes
Given the node map Given the node map
| | | | | g | | | | | | | g | |
@ -396,6 +406,7 @@ Feature: Turn Lane Guidance
| a,e | road,through,through | depart,new name straight,arrive | ,left:false straight:true right:false, | | a,e | road,through,through | depart,new name straight,arrive | ,left:false straight:true right:false, |
| a,f | road,right,right | depart,turn right,arrive | ,left:false straight:false right:true, | | a,f | road,right,right | depart,turn right,arrive | ,left:false straight:false right:true, |
@previous-lanes
Scenario: Turn at a traffic light Scenario: Turn at a traffic light
Given the node map Given the node map
| a | b | c | d | | a | b | c | d |
@ -417,7 +428,7 @@ Feature: Turn Lane Guidance
| a,d | road,road | depart,arrive | , | | a,d | road,road | depart,arrive | , |
| a,e | road,turn,turn | depart,turn right,arrive | ,straight:false right:true, | | a,e | road,turn,turn | depart,turn right,arrive | ,straight:false right:true, |
@bug @todo @bug @todo @roundabout
Scenario: Theodor Heuss Platz Scenario: Theodor Heuss Platz
Given the node map Given the node map
| | | | i | o | | | l | | | | | | i | o | | | l | |
@ -454,6 +465,7 @@ Feature: Turn Lane Guidance
| i,l | top,top-right-out,top-right-out | depart,roundabout-exit-4,arrive | ,slight left:true slight left;slight right:true slight right:false slight right:false, | | i,l | top,top-right-out,top-right-out | depart,roundabout-exit-4,arrive | ,slight left:true slight left;slight right:true slight right:false slight right:false, |
| i,o | top,top,top | depart,roundabout-exit-5,arrive | ,, | | i,o | top,top,top | depart,roundabout-exit-5,arrive | ,, |
@sliproads
Scenario: Turn Lanes Breaking up Scenario: Turn Lanes Breaking up
Given the node map Given the node map
| | | | g | | | | | | g | |
@ -466,12 +478,12 @@ Feature: Turn Lane Guidance
And the ways And the ways
| nodes | name | turn:lanes:forward | oneway | highway | | nodes | name | turn:lanes:forward | oneway | highway |
| ab | road | left\|left\|through\|through\|right | yes | primary | | ab | road | left\|left\|through\|through\|right | yes | primary |
| bd | road | through\|through | yes | primary | | bd | road | through\|through\|right | yes | primary |
| bc | road | left\|left | yes | primary | | bc | road | left\|left | yes | primary |
| de | road | | yes | primary | | de | road | | yes | primary |
| fd | cross | | | secondary | | fd | cross | | | secondary |
| dc | cross | | | secondary | | dc | cross | | | secondary |
| cg | cross | | | secondary | | cg | cross | | | secondary |
And the relations And the relations
| type | way:from | way:to | node:via | restriction | | type | way:from | way:to | node:via | restriction |
@ -484,6 +496,7 @@ Feature: Turn Lane Guidance
| a,e | road,road | depart,arrive | , | | a,e | road,road | depart,arrive | , |
#NEEDS TO BE INVESTIGATED. Turn restriction shouldn't be here. See #2867 #NEEDS TO BE INVESTIGATED. Turn restriction shouldn't be here. See #2867
@reverse @previous-lanes
Scenario: U-Turn Road at Intersection Scenario: U-Turn Road at Intersection
Given the node map Given the node map
| | | | | | h | | | | | | | | h | |
@ -517,6 +530,7 @@ Feature: Turn Lane Guidance
| a | i | 180,180 180,180 | road,road | depart,arrive | , | | a | i | 180,180 180,180 | road,road | depart,arrive | , |
| b | a | 90,2 270,2 | road,road,road | depart,continue uturn,arrive | ,none:true straight:false right:false, | | b | a | 90,2 270,2 | road,road,road | depart,continue uturn,arrive | ,none:true straight:false right:false, |
@reverse
Scenario: Segregated Intersection Merges With Lanes Scenario: Segregated Intersection Merges With Lanes
Given the node map Given the node map
| | | | | | | f | | | | | | | | f |
@ -541,7 +555,7 @@ Feature: Turn Lane Guidance
| a,e | road,road,road | depart,turn uturn,arrive | ,left:true left:false left:false straight:false straight:false, | | a,e | road,road,road | depart,turn uturn,arrive | ,left:true left:false left:false straight:false straight:false, |
| a,g | road,straight,straight | depart,new name straight,arrive | ,left:false left:false left:false straight:true straight:true, | | a,g | road,straight,straight | depart,new name straight,arrive | ,left:false left:false left:false straight:true straight:true, |
@bug @todo @bug @todo @roundabout
Scenario: Passing Through a Roundabout Scenario: Passing Through a Roundabout
Given the node map Given the node map
| | | h | | g | | | | | | h | | g | | |
@ -568,6 +582,7 @@ Feature: Turn Lane Guidance
| i,j | left,bottom,bottom | depart,round-exit-1,arrive | ,0, | | i,j | left,bottom,bottom | depart,round-exit-1,arrive | ,0, |
| i,k | left,right,right | depart,round-exit-2,arrive | ,1, | | i,k | left,right,right | depart,round-exit-2,arrive | ,1, |
@previous-lanes
Scenario: Crossing Traffic Light Scenario: Crossing Traffic Light
Given the node map Given the node map
| a | | b | | c | | d | | a | | b | | c | | d |
@ -588,6 +603,7 @@ Feature: Turn Lane Guidance
| a,d | road,road | depart,arrive | , | | a,d | road,road | depart,arrive | , |
| a,e | road,cross,cross | depart,turn slight right,arrive | ,straight:false straight:false straight;slight right:true slight right:true, | | a,e | road,cross,cross | depart,turn slight right,arrive | ,straight:false straight:false straight;slight right:true slight right:true, |
@ramp
Scenario: Highway Ramp Scenario: Highway Ramp
Given the node map Given the node map
| a | | b | | c | | d | | a | | b | | c | | d |
@ -626,6 +642,7 @@ Feature: Turn Lane Guidance
| a,g | off,road,road | depart,turn_left,arrive | ,left:true right:false, | | a,g | off,road,road | depart,turn_left,arrive | ,left:true right:false, |
| a,h | | | | | a,h | | | |
@ramp
Scenario: Off Ramp In a Turn Scenario: Off Ramp In a Turn
Given the node map Given the node map
| a | | | | | | | | | | | | | a | | | | | | | | | | | |
@ -644,6 +661,7 @@ Feature: Turn Lane Guidance
| a,c | hwy,hwy | depart,arrive | , | | a,c | hwy,hwy | depart,arrive | , |
| a,d | hwy,ramp,ramp | depart,off ramp slight right,arrive | ,straight:false straight:false slight right:true, | | a,d | hwy,ramp,ramp | depart,off ramp slight right,arrive | ,straight:false straight:false slight right:true, |
@reverse
Scenario: Reverse Lane in Segregated Road Scenario: Reverse Lane in Segregated Road
Given the node map Given the node map
| h | | | | | g | | | | | | f | | h | | | | | g | | | | | | f |
@ -662,6 +680,7 @@ Feature: Turn Lane Guidance
| waypoints | route | turns | lanes | | waypoints | route | turns | lanes |
| a,h | road,road,road | depart,continue uturn,arrive | ,uturn:true straight:false straight:false,| | a,h | road,road,road | depart,continue uturn,arrive | ,uturn:true straight:false straight:false,|
@reverse
Scenario: Reverse Lane in Segregated Road with none Scenario: Reverse Lane in Segregated Road with none
Given the node map Given the node map
| h | | | | | g | | | | | | f | | h | | | | | g | | | | | | f |
@ -680,6 +699,7 @@ Feature: Turn Lane Guidance
| waypoints | route | turns | lanes | | waypoints | route | turns | lanes |
| a,h | road,road,road | depart,continue uturn,arrive | ,uturn:true straight:false none:false, | | a,h | road,road,road | depart,continue uturn,arrive | ,uturn:true straight:false none:false, |
@reverse
Scenario: Reverse Lane in Segregated Road with none, Service Turn Prior Scenario: Reverse Lane in Segregated Road with none, Service Turn Prior
Given the node map Given the node map
| h | | | | | g | | | | | | f | | h | | | | | g | | | | | | f |
@ -700,6 +720,7 @@ Feature: Turn Lane Guidance
| waypoints | route | turns | lanes | | waypoints | route | turns | lanes |
| a,h | road,road,road | depart,continue uturn,arrive | ,uturn:true straight:false none:false, | | a,h | road,road,road | depart,continue uturn,arrive | ,uturn:true straight:false none:false, |
@simple
Scenario: Don't collapse everything to u-turn / too wide Scenario: Don't collapse everything to u-turn / too wide
Given the node map Given the node map
| a | | b | | e | | a | | b | | e |
@ -719,6 +740,7 @@ Feature: Turn Lane Guidance
| a,d | depart,continue right,turn right,arrive | road,road,road,road | ,straight:false right:true,, | | a,d | depart,continue right,turn right,arrive | road,road,road,road | ,straight:false right:true,, |
| d,a | depart,continue left,turn left,arrive | road,road,road,road | ,left:true straight:false,, | | d,a | depart,continue left,turn left,arrive | road,road,road,road | ,left:true straight:false,, |
@simple
Scenario: Merge Lanes Onto Freeway Scenario: Merge Lanes Onto Freeway
Given the node map Given the node map
| a | | | b | c | | a | | | b | c |
@ -733,7 +755,7 @@ Feature: Turn Lane Guidance
| waypoints | turns | route | lanes | | waypoints | turns | route | lanes |
| d,c | depart,merge slight left,arrive | ramp,Hwy,Hwy | ,slight right:true slight right:true, | | d,c | depart,merge slight left,arrive | ramp,Hwy,Hwy | ,slight right:true slight right:true, |
@2654 @2654 @simple
Scenario: Fork on motorway links - don't fork on through but use lane Scenario: Fork on motorway links - don't fork on through but use lane
Given the node map Given the node map
| i | | | | | a | | i | | | | | a |
@ -803,7 +825,7 @@ Feature: Turn Lane Guidance
| waypoints | route | turns | lanes | | waypoints | route | turns | lanes |
| x,d | road,road | depart,arrive | , | | x,d | road,road | depart,arrive | , |
@partition @partition-lanes
Scenario: Partitioned turn, Slight Curve Scenario: Partitioned turn, Slight Curve
Given the node map Given the node map
| | | f | | e | | | | f | | e |

View File

@ -22,6 +22,10 @@ struct TurnLaneData
LaneID from; LaneID from;
LaneID to; LaneID to;
// a temporary data entry that does not need to be assigned to an entry.
// This is the case in situations that use partition and require the entry to perform the
// one-to-one mapping.
bool suppress_assignment;
bool operator<(const TurnLaneData &other) const; bool operator<(const TurnLaneData &other) const;
}; };
typedef std::vector<TurnLaneData> LaneDataVector; typedef std::vector<TurnLaneData> LaneDataVector;

View File

@ -125,9 +125,7 @@ class TurnLaneHandler
Intersection handleSliproadTurn(Intersection intersection, Intersection handleSliproadTurn(Intersection intersection,
const LaneDescriptionID lane_description_id, const LaneDescriptionID lane_description_id,
LaneDataVector lane_data, LaneDataVector lane_data,
const Intersection &previous_intersection, const Intersection &previous_intersection);
const LaneDescriptionID &previous_lane_description_id,
const LaneDataVector &previous_lane_data);
// get the lane data for an intersection // get the lane data for an intersection
void extractLaneData(const EdgeID via_edge, void extractLaneData(const EdgeID via_edge,

View File

@ -83,7 +83,9 @@ inline void print(const extractor::guidance::lanes::LaneDataVector &turn_lane_da
std::cout << "\t" << entry.tag << "(" std::cout << "\t" << entry.tag << "("
<< extractor::guidance::TurnLaneType::toString(entry.tag) << extractor::guidance::TurnLaneType::toString(entry.tag)
<< ") from: " << static_cast<int>(entry.from) << ") from: " << static_cast<int>(entry.from)
<< " to: " << static_cast<int>(entry.to) << "\n"; << " to: " << static_cast<int>(entry.to)
<< " Can Be Suppresssed: " << (entry.suppress_assignment ? "true" : "false")
<< "\n";
std::cout << std::flush; std::cout << std::flush;
} }

View File

@ -77,7 +77,8 @@ bool collapsable(const RouteStep &step, const RouteStep &next)
const auto instruction_can_be_collapsed = isCollapsableInstruction(step.maneuver.instruction); const auto instruction_can_be_collapsed = isCollapsableInstruction(step.maneuver.instruction);
const auto is_use_lane = step.maneuver.instruction.type == TurnType::UseLane; const auto is_use_lane = step.maneuver.instruction.type == TurnType::UseLane;
const auto lanes_dont_change = step.maneuver.lanes == next.maneuver.lanes; const auto lanes_dont_change =
step.intersections.front().lanes == next.intersections.front().lanes;
if (is_short_step && instruction_can_be_collapsed) if (is_short_step && instruction_can_be_collapsed)
return true; return true;

View File

@ -118,7 +118,8 @@ LaneDataVector augmentMultiple(const std::size_t none_index,
lane_data.push_back({tag_by_modifier[intersection[intersection_index] lane_data.push_back({tag_by_modifier[intersection[intersection_index]
.turn.instruction.direction_modifier], .turn.instruction.direction_modifier],
lane_data[none_index].from, lane_data[none_index].from,
lane_data[none_index].to}); lane_data[none_index].to,
false});
} }
} }
lane_data.erase(lane_data.begin() + none_index); lane_data.erase(lane_data.begin() + none_index);

View File

@ -30,6 +30,7 @@ bool TurnLaneData::operator<(const TurnLaneData &other) const
if (to > other.to) if (to > other.to)
return false; return false;
// the suppress-assignment flag is ignored, since it does not influence the order
const constexpr TurnLaneType::Mask tag_by_modifier[] = {TurnLaneType::sharp_right, const constexpr TurnLaneType::Mask tag_by_modifier[] = {TurnLaneType::sharp_right,
TurnLaneType::right, TurnLaneType::right,
TurnLaneType::slight_right, TurnLaneType::slight_right,
@ -67,7 +68,7 @@ bool TurnLaneData::operator<(const TurnLaneData &other) const
LaneDataVector laneDataFromDescription(TurnLaneDescription turn_lane_description) LaneDataVector laneDataFromDescription(TurnLaneDescription turn_lane_description)
{ {
typedef std::unordered_map<TurnLaneType::Mask, std::pair<LaneID, LaneID>> LaneMap; typedef std::unordered_map<TurnLaneType::Mask, std::pair<LaneID, LaneID>> LaneMap;
//TODO need to handle cases that have none-in between two identical values // TODO need to handle cases that have none-in between two identical values
const auto num_lanes = boost::numeric_cast<LaneID>(turn_lane_description.size()); const auto num_lanes = boost::numeric_cast<LaneID>(turn_lane_description.size());
const auto setLaneData = [&]( const auto setLaneData = [&](
@ -106,7 +107,7 @@ LaneDataVector laneDataFromDescription(TurnLaneDescription turn_lane_description
// transform the map into the lane data vector // transform the map into the lane data vector
LaneDataVector lane_data; LaneDataVector lane_data;
for (const auto tag : lane_map) for (const auto tag : lane_map)
lane_data.push_back({tag.first, tag.second.first, tag.second.second}); lane_data.push_back({tag.first, tag.second.first, tag.second.second, false});
std::sort(lane_data.begin(), lane_data.end()); std::sort(lane_data.begin(), lane_data.end());
@ -158,8 +159,8 @@ bool isSubsetOf(const LaneDataVector &subset_candidate, const LaneDataVector &su
auto location = superset_candidate.begin(); auto location = superset_candidate.begin();
for (const auto entry : subset_candidate) for (const auto entry : subset_candidate)
{ {
location = location = std::find_if(
std::find_if(location, superset_candidate.end(), [entry](const TurnLaneData &lane_data) { location, superset_candidate.end(), [entry](const TurnLaneData &lane_data) {
return lane_data.tag == entry.tag; return lane_data.tag == entry.tag;
}); });

View File

@ -8,6 +8,7 @@
#include "util/simple_logger.hpp" #include "util/simple_logger.hpp"
#include "util/typedefs.hpp" #include "util/typedefs.hpp"
#include <cstddef>
#include <cstdint> #include <cstdint>
#include <boost/algorithm/string/predicate.hpp> #include <boost/algorithm/string/predicate.hpp>
@ -106,8 +107,6 @@ TurnLaneHandler::assignTurnLanes(const NodeID at, const EdgeID via_edge, Interse
previous_lane_data, previous_lane_data,
previous_description_id); previous_description_id);
std::cout << "[turn lane] " << scenario_names[scenario] << std::endl;
if (scenario != TurnLaneHandler::NONE) if (scenario != TurnLaneHandler::NONE)
(*count_called)++; (*count_called)++;
@ -132,9 +131,7 @@ TurnLaneHandler::assignTurnLanes(const NodeID at, const EdgeID via_edge, Interse
return handleSliproadTurn(std::move(intersection), return handleSliproadTurn(std::move(intersection),
lane_description_id, lane_description_id,
std::move(lane_data), std::move(lane_data),
previous_intersection, previous_intersection);
previous_description_id,
previous_lane_data);
case TurnLaneScenario::MERGE: case TurnLaneScenario::MERGE:
return intersection; return intersection;
default: default:
@ -295,7 +292,7 @@ TurnLaneHandler::deduceScenario(const NodeID at,
// FIXME the lane to add depends on the side of driving/u-turn rules in the country // FIXME the lane to add depends on the side of driving/u-turn rules in the country
if (!lane_data.empty() && canMatchTrivially(intersection, lane_data) && if (!lane_data.empty() && canMatchTrivially(intersection, lane_data) &&
is_missing_valid_u_turn && !hasTag(TurnLaneType::none, lane_data)) is_missing_valid_u_turn && !hasTag(TurnLaneType::none, lane_data))
lane_data.push_back({TurnLaneType::uturn, lane_data.back().to, lane_data.back().to}); lane_data.push_back({TurnLaneType::uturn, lane_data.back().to, lane_data.back().to, false});
bool is_simple = isSimpleIntersection(lane_data, intersection); bool is_simple = isSimpleIntersection(lane_data, intersection);
@ -663,6 +660,8 @@ std::pair<LaneDataVector, LaneDataVector> TurnLaneHandler::partitionLaneData(
if (lane == straightmost_tag_index) if (lane == straightmost_tag_index)
{ {
augmentEntry(turn_lane_data[straightmost_tag_index]); augmentEntry(turn_lane_data[straightmost_tag_index]);
// disable this turn for assignment if it is a -use lane only
turn_lane_data[straightmost_tag_index].suppress_assignment = true;
} }
if (matched_at_first[lane]) if (matched_at_first[lane])
@ -674,7 +673,7 @@ std::pair<LaneDataVector, LaneDataVector> TurnLaneHandler::partitionLaneData(
std::count(matched_at_second.begin(), matched_at_second.end(), true)) == std::count(matched_at_second.begin(), matched_at_second.end(), true)) ==
getNumberOfTurns(next_intersection)) getNumberOfTurns(next_intersection))
{ {
TurnLaneData data = {TurnLaneType::straight, 255, 0}; TurnLaneData data = {TurnLaneType::straight, 255, 0, true};
augmentEntry(data); augmentEntry(data);
first.push_back(data); first.push_back(data);
std::sort(first.begin(), first.end()); std::sort(first.begin(), first.end());
@ -701,15 +700,12 @@ Intersection TurnLaneHandler::simpleMatchTuplesToTurns(Intersection intersection
std::move(intersection), lane_data, node_based_graph, lane_description_id, id_map); std::move(intersection), lane_data, node_based_graph, lane_description_id, id_map);
} }
Intersection Intersection TurnLaneHandler::handleSliproadTurn(Intersection intersection,
TurnLaneHandler::handleSliproadTurn(Intersection intersection, const LaneDescriptionID lane_description_id,
const LaneDescriptionID lane_description_id, LaneDataVector lane_data,
LaneDataVector lane_data, const Intersection &previous_intersection)
const Intersection &previous_intersection,
const LaneDescriptionID &previous_lane_description_id,
const LaneDataVector &previous_lane_data)
{ {
const auto sliproad_index = const std::size_t sliproad_index =
std::distance(previous_intersection.begin(), std::distance(previous_intersection.begin(),
std::find_if(previous_intersection.begin(), std::find_if(previous_intersection.begin(),
previous_intersection.end(), previous_intersection.end(),

View File

@ -256,7 +256,8 @@ Intersection triviallyMatchLanesToTurns(Intersection intersection,
BOOST_ASSERT(findBestMatch(lane_data[lane].tag, intersection) == BOOST_ASSERT(findBestMatch(lane_data[lane].tag, intersection) ==
intersection.begin() + road_index); intersection.begin() + road_index);
if (TurnType::Suppressed == intersection[road_index].turn.instruction.type) if (TurnType::Suppressed == intersection[road_index].turn.instruction.type &&
!lane_data[lane].suppress_assignment)
intersection[road_index].turn.instruction.type = TurnType::UseLane; intersection[road_index].turn.instruction.type = TurnType::UseLane;
matchRoad(intersection[road_index], lane_data[lane]); matchRoad(intersection[road_index], lane_data[lane]);