deprecate use-lane -- the information can be found in the intersections array

This commit is contained in:
Moritz Kobitzsch 2017-07-10 12:46:18 +02:00
parent 7d63301039
commit 7b755d6f8b
12 changed files with 165 additions and 215 deletions

View File

@ -657,7 +657,7 @@ step.
| `off ramp` | take a ramp to exit a highway (direction given my `modifier`) |
| `fork` | take the left/right side at a fork depending on `modifier` |
| `end of road` | road ends in a T intersection turn in direction of `modifier`|
| `use lane` | going straight on a specific lane |
| `use lane` | going straight on a specific lane -- deprecated, use the intersections information |
| `continue` | Turn in direction of `modifier` to stay on the same road |
| `roundabout` | traverse roundabout, has additional property `exit` with NR if the roundabout is left. The modifier specifies the direction of entering the roundabout. |
| `rotary` | a traffic circle. While very similar to a larger version of a roundabout, it does not necessarily follow roundabout rules for right of way. It can offer `rotary_name` and/or `rotary_pronunciation` parameters (located in the RouteStep object) in addition to the `exit` parameter (located on the StepManeuver object). |

View File

@ -35,10 +35,10 @@ Feature: Turn Lane Guidance
| restriction | bc | cd | c | no_right_turn |
When I route I should get
| waypoints | route | turns | lanes |
| a,e | in,cross,cross | depart,turn left,arrive | ,left:true straight:false, |
| a,g | in,straight,straight | depart,new name straight,arrive | ,left:false straight:true, |
| a,f | in,cross,cross | depart,continue right,arrive | ,, |
| waypoints | route | turns | lanes |
| a,e | in,cross,cross | depart,turn left,arrive | ;,left:true straight:false, |
| a,g | in,straight,straight | depart,new name straight,arrive | ;,left:false straight:true, |
| a,f | in,cross,cross | depart,continue right,arrive | ,;right:true, |
@sliproads
Scenario: Separate Turn Lanes
@ -68,10 +68,10 @@ Feature: Turn Lane Guidance
| restriction | bc | cd | c | no_right_turn |
When I route I should get
| waypoints | route | turns | lanes |
| a,e | in,cross,cross | depart,turn left,arrive | ,left:true straight:false 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, |
| waypoints | route | turns | lanes |
| a,e | in,cross,cross | depart,turn left,arrive | ;,left:true straight:false 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;left:false straight:false right:true, |
@sliproads
@ -109,12 +109,12 @@ Feature: Turn Lane Guidance
| restriction | bc | cd | c | no_right_turn |
When I route I should get
| waypoints | route | turns | lanes |
| a,e | in,cross,cross | depart,turn left,arrive | ,left:true straight:false 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,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, |
| waypoints | route | turns | lanes |
| a,e | in,cross,cross | depart,turn left,arrive | ;,left:true straight:false 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;left:false straight:false right:true, |
| 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, |
@todo @2654 @none

View File

@ -151,9 +151,9 @@ Feature: Turn Lane Guidance
| cj | | 1 | motorway_link | yes | xbcj |
When I route I should get
| waypoints | route | turns | lanes |
| a,i | ab,ci,ci | depart,turn slight right,arrive | ,none:false slight right:true, |
| a,j | ab,xbcj | depart,arrive | , |
| waypoints | route | turns | lanes |
| a,i | ab,ci,ci | depart,turn slight right,arrive | ;,none:false slight right:true, |
| a,j | ab,xbcj | depart,arrive | ;;none:true slight right:false, |
@anticipate
@ -308,8 +308,8 @@ Feature: Turn Lane Guidance
| di | | off | | yes |
When I route I should get
| waypoints | route | turns | destinations | lanes | locations |
| a,e | main,main,main | depart,use lane straight,arrive | One,Two,Three | ,left:false straight:false straight:true straight:false right:false, | a,c,e |
| waypoints | route | turns | destinations | locations | lanes |
| a,e | main,main | depart,arrive | One,Three | a,e | ;left:false straight:false straight:true straight:false right:false;left:false straight:true right:false, |
@anticipate
Scenario: Anticipate Lanes for through and collapse multiple use lanes
@ -335,9 +335,9 @@ Feature: Turn Lane Guidance
| dj | | off |
When I route I should get
| waypoints | route | turns | lanes |
| a,c | main,main | depart,arrive | , |
| a,d | main,main | depart,arrive | , |
| waypoints | route | turns | lanes |
| a,c | main,main | depart,arrive | ;left:false straight:true straight:true right:false, |
| a,d | main,main | depart,arrive | ;left:false straight:true straight:true right:false;left:false straight:true straight:true right:false, |
@anticipate
Scenario: Anticipate Lanes for through followed by left/right
@ -363,9 +363,9 @@ Feature: Turn Lane Guidance
| ci | | off |
When I route I should get
| waypoints | route | turns | lanes |
| a,d | main,main,main,left,left | depart,use lane straight,use lane straight,turn left,arrive | ,left:false straight:false straight:true straight:false straight:false right:false,left:false straight:true straight:false right:false,left:true right:false, |
| a,e | main,main,main,right,right | depart,use lane straight,use lane straight,turn right,arrive | ,left:false straight:false straight:false straight:true straight:false right:false,left:false straight:false straight:true right:false,left:false right:true, |
| waypoints | route | turns | lanes |
| a,d | main,left,left | depart,end of road left,arrive | ;left:false straight:false straight:true straight:false straight:false right:false;left:false straight:true straight:false right:false,left:true right:false, |
| a,e | main,right,right | depart,end of road right,arrive | ;left:false straight:false straight:false straight:true straight:false right:false;left:false straight:false straight:true right:false,left:false right:true, |
@anticipate
Scenario: Anticipate Lanes for through with turn before / after
@ -390,15 +390,15 @@ Feature: Turn Lane Guidance
| il | | il | |
When I route I should get
| waypoints | route | turns | lanes | # |
| a,f | ab,bdehi,ef,ef | depart,turn right,turn right,arrive | ,right:false right:false right:true right:true,left:false left:false straight:false straight:false straight:false straight:false right:true right:true, | |
| a,g | ab,bdehi,eg,eg | depart,turn right,turn left,arrive | ,right:true right:true right:false right:false,left:true left:true straight:false straight:false straight:false straight:false right:false right:false, | |
| a,j | ab,bdehi,bdehi,ij,ij | depart,turn right,use lane straight,turn right,arrive | ,right:true right:true right:false right:false,left:false left:false straight:false straight:false straight:true straight:true right:false right:false,left:false left:false right:true right:true, | |
| a,l | ab,bdehi,bdehi,il,il | depart,turn right,use lane straight,turn left,arrive | ,right:false right:false right:true right:true,left:false left:false straight:true straight:true straight:false straight:false right:false right:false,left:true left:true right:false right:false, | not perfect |
| c,g | cb,bdehi,eg,eg | depart,turn left,turn left,arrive | ,left:true left:true left:false left:false,left:true left:true straight:false straight:false straight:false straight:false right:false right:false, | |
| c,f | cb,bdehi,ef,ef | depart,turn left,turn right,arrive | ,left:false left:false left:true left:true,left:false left:false straight:false straight:false straight:false straight:false right:true right:true, | |
| c,l | cb,bdehi,bdehi,il,il | depart,turn left,use lane straight,turn left,arrive | ,left:false left:false left:true left:true,left:false left:false straight:true straight:true straight:false straight:false right:false right:false,left:true left:true right:false right:false, | |
| c,j | cb,bdehi,bdehi,ij,ij | depart,turn left,use lane straight,turn right,arrive | ,left:true left:true left:false left:false,left:false left:false straight:false straight:false straight:true straight:true right:false right:false,left:false left:false right:true right:true, | not perfect |
| waypoints | route | turns | lanes | # |
| a,f | ab,bdehi,ef,ef | depart,turn right,turn right,arrive | ,right:false right:false right:true right:true,left:false left:false straight:false straight:false straight:false straight:false right:true right:true, | |
| a,g | ab,bdehi,eg,eg | depart,turn right,turn left,arrive | ,right:true right:true right:false right:false,left:true left:true straight:false straight:false straight:false straight:false right:false right:false, | |
| a,j | ab,bdehi,ij,ij | depart,turn right,end of road right,arrive | ,right:true right:true right:false right:false;left:false left:false straight:false straight:false straight:true straight:true right:false right:false,left:false left:false right:true right:true, | |
| a,l | ab,bdehi,il,il | depart,turn right,end of road left,arrive | ,right:false right:false right:true right:true;left:false left:false straight:true straight:true straight:false straight:false right:false right:false,left:true left:true right:false right:false, | not perfect |
| c,g | cb,bdehi,eg,eg | depart,turn left,turn left,arrive | ,left:true left:true left:false left:false,left:true left:true straight:false straight:false straight:false straight:false right:false right:false, | |
| c,f | cb,bdehi,ef,ef | depart,turn left,turn right,arrive | ,left:false left:false left:true left:true,left:false left:false straight:false straight:false straight:false straight:false right:true right:true, | |
| c,l | cb,bdehi,il,il | depart,turn left,end of road left,arrive | ,left:false left:false left:true left:true;left:false left:false straight:true straight:true straight:false straight:false right:false right:false,left:true left:true right:false right:false, | |
| c,j | cb,bdehi,ij,ij | depart,turn left,end of road right,arrive | ,left:true left:true left:false left:false;left:false left:false straight:false straight:false straight:true straight:true right:false right:false,left:false left:false right:true right:true, | not perfect |
@anticipate
Scenario: Anticipate Lanes for turns with through before and after
@ -431,11 +431,11 @@ Feature: Turn Lane Guidance
| jk | | bot | primary | yes |
When I route I should get
| waypoints | route | turns | lanes |
| a,i | top,main,main,top,top | depart,turn right,use lane straight,turn left,arrive | ,straight:false right:false right:true right:true,left:false straight:true straight:true straight:false straight:false right:false,left:true left:true right:false right:false, |
| a,k | top,main,main,bot,bot | depart,turn right,use lane straight,turn right,arrive | ,straight:false right:true right:true right:false,left:false straight:false straight:false straight:true straight:true right:false,left:false left:false right:true right:true, |
| c,i | bot,main,main,top,top | depart,turn left,use lane straight,turn left,arrive | ,left:false left:true left:true straight:false,left:false straight:true straight:true straight:false straight:false right:false,left:true left:true right:false right:false, |
| c,k | bot,main,main,bot,bot | depart,turn left,use lane straight,turn right,arrive | ,left:true left:true left:false straight:false,left:false straight:false straight:false straight:true straight:true right:false,left:false left:false right:true right:true, |
| waypoints | route | turns | lanes |
| a,i | top,main,top,top | depart,turn right,turn left,arrive | ,straight:false right:true right:true right:true;;left:false straight:true straight:true straight:false straight:false right:false,left:true left:true right:false right:false, |
| a,k | top,main,bot,bot | depart,turn right,turn right,arrive | ,straight:false right:true right:true right:true;;left:false straight:false straight:false straight:true straight:true right:false,left:false left:false right:true right:true, |
| c,i | bot,main,top,top | depart,turn left,turn left,arrive | ,left:true left:true left:true straight:false;;left:false straight:true straight:true straight:false straight:false right:false,left:true left:true right:false right:false, |
| c,k | bot,main,bot,bot | depart,turn left,turn right,arrive | ,left:true left:true left:true straight:false;;left:false straight:false straight:false straight:true straight:true right:false,left:false left:false right:true right:true, |
@anticipate
Scenario: Anticipate Lanes for turn between throughs
@ -462,8 +462,8 @@ Feature: Turn Lane Guidance
| dt | | off |
When I route I should get
| waypoints | route | turns | lanes |
| a,e | main,main,main,main | depart,use lane straight,continue right,arrive | ,left:false straight:false straight:false straight:false straight:true straight:true right:false,straight:false straight:false right:false right:true right:true, |
| waypoints | route | turns | lanes |
| a,e | main,main,main | depart,continue right,arrive | ;left:false straight:false straight:false straight:false straight:true straight:true right:false,straight:false straight:false right:false right:true right:true;left:false straight:true straight:true, |
@anticipate @todo @2661
Scenario: Anticipate with lanes in roundabout: roundabouts as the unit of anticipation
@ -520,8 +520,8 @@ Feature: Turn Lane Guidance
| df | | primary | |
When I route I should get
| waypoints | route | turns | lanes |
| a,f | ab,df,df | depart,roundabout-exit-1,use lane slight right,arrive | ,,slight left:false slight left:false slight right:true, |
| waypoints | route | turns | lanes | intersection_lanes |
| a,f | ab,df,df | depart,roundabout-exit-1,arrive | ,, | |
@anticipate
Scenario: No Lanes for Roundabouts, see #2626
@ -553,8 +553,8 @@ Feature: Turn Lane Guidance
| fy | | primary | |
When I route I should get
| waypoints | route | turns | lanes |
| a,h | ab,gh,gh | depart,roundabout-exit-5,arrive | ,, |
| waypoints | route | turns | lanes |
| a,h | ab,gh,gh | depart,roundabout-exit-5,arrive | ,;;;;;, |
@anticipate
Scenario: No Lanes for Roundabouts, see #2626
@ -576,9 +576,9 @@ Feature: Turn Lane Guidance
When I route I should get
| waypoints | route | turns | lanes |
| x,y | xb,dy,dy | depart,roundabout-exit-1,arrive | ,, |
| x,y | xb,dy,dy | depart,roundabout-exit-1,arrive | ,;, |
| x,c | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
| x,a | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
| x,a | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,;, |
@anticipate
Scenario: No Lanes for Roundabouts, see #2626
@ -614,8 +614,8 @@ Feature: Turn Lane Guidance
| fy | | primary | |
When I route I should get
| waypoints | route | turns | lanes |
| a,h | ab,ch,ch | depart,roundabout-exit-5,arrive | ,, |
| waypoints | route | turns | lanes |
| a,h | ab,ch,ch | depart,roundabout-exit-5,arrive | ,;;;;;, |
@anticipate
Scenario: No Lanes for Roundabouts, see #2626
@ -671,9 +671,9 @@ Feature: Turn Lane Guidance
When I route I should get
| waypoints | route | turns | lanes |
| x,y | xb,dy,dy | depart,roundabout-exit-1,arrive | ,, |
| x,y | xb,dy,dy | depart,roundabout-exit-1,arrive | ,;, |
| x,c | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
| x,a | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,, |
| x,a | xb,roundabout,roundabout | depart,roundabout-exit-undefined,arrive | ,;, |
@anticipate @todo @2032
Scenario: No Lanes for Roundabouts, see #2626
@ -849,6 +849,6 @@ Feature: Turn Lane Guidance
| hj | 7th | | no |
When I route I should get
| waypoints | route | turns | locations | lanes |
| a,i | road,road,road | depart,use lane straight,arrive | a,g,i | ,left:false none:true none:true none:false, |
| a,j | road,road,7th,7th | depart,use lane straight,turn right,arrive | a,f,h,j | ,left:false none:false none:false none:true,none:false none:false right:true, |
| waypoints | route | turns | locations | lanes |
| a,i | road,road | depart,arrive | a,i | ;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:false;none:true none:true right:false, |
| a,j | road,7th,7th | depart,turn right,arrive | a,h,j | ;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:true none:true none:true;left:false none:false none:false none:true;left:false none:false none:false none:true,none:false none:false right:true, |

View File

@ -807,8 +807,8 @@ Feature: Collapse
| di | | off |
When I route I should get
| waypoints | route | turns | locations |
| a,e | main,main,main | depart,use lane straight,arrive | a,c,e |
| waypoints | route | turns | locations | lanes |
| a,e | main,main | depart,arrive | a,e | ;left:false straight:false straight:true straight:false right:false;left:false straight:true right:false, |
Scenario: But _do_ collapse UseLane step when lanes stay the same
Given the node map

View File

@ -606,11 +606,11 @@ Feature: Basic Roundabout
| ob | trunk | yes | roundabout | Europaplatz | |
When I route I should get
| waypoints | route | turns | lanes |
| a,d | ,Europastrasse,Europastrasse | depart,Europaplatz-exit-1,arrive | ,, |
| a,h | ,Allee Cite,Allee Cite | depart,Europaplatz-exit-2,arrive | ,, |
| a,l | ,Europastrasse,Europastrasse | depart,Europaplatz-exit-3,arrive | ,, |
| a,p | ,, | depart,Europaplatz-exit-4,arrive | ,, |
| waypoints | route | turns |
| a,d | ,Europastrasse,Europastrasse | depart,Europaplatz-exit-1,arrive |
| a,h | ,Allee Cite,Allee Cite | depart,Europaplatz-exit-2,arrive |
| a,l | ,Europastrasse,Europastrasse | depart,Europaplatz-exit-3,arrive |
| a,p | ,, | depart,Europaplatz-exit-4,arrive |
@turboroundabout
# http://www.openstreetmap.org/?mlat=50.180039&mlon=8.474939&zoom=16#map=19/50.17999/8.47506
@ -658,14 +658,14 @@ Feature: Basic Roundabout
| wb | primary | yes | roundabout | | through\|through;right |
When I route I should get
| waypoints | route | turns | lanes |
| a,w | Le-Cannet-Rocheville-Strasse,, | depart,roundabout-exit-undefined,arrive | ,, |
| a,r | Le-Cannet-Rocheville-Strasse,, | depart,roundabout-exit-4,arrive | ,, |
| a,f | Le-Cannet-Rocheville-Strasse,Frankfurter Strasse,Frankfurter Strasse | depart,roundabout-exit-1,arrive | ,, |
| a,h | Le-Cannet-Rocheville-Strasse,Bischof-Kaller-Strasse,Bischof-Kaller-Strasse | depart,roundabout-exit-2,arrive | ,, |
| u,r | ,, | depart,roundabout-exit-5,arrive | ,, |
| j,h | Bischof-Kaller-Strasse,Bischof-Kaller-Strasse,Bischof-Kaller-Strasse | depart,roundabout-exit-5,arrive | ,, |
| n,m | , | depart,arrive | , |
| waypoints | route | turns |
| a,w | Le-Cannet-Rocheville-Strasse,, | depart,roundabout-exit-undefined,arrive |
| a,r | Le-Cannet-Rocheville-Strasse,, | depart,roundabout-exit-4,arrive |
| a,f | Le-Cannet-Rocheville-Strasse,Frankfurter Strasse,Frankfurter Strasse | depart,roundabout-exit-1,arrive |
| a,h | Le-Cannet-Rocheville-Strasse,Bischof-Kaller-Strasse,Bischof-Kaller-Strasse | depart,roundabout-exit-2,arrive |
| u,r | ,, | depart,roundabout-exit-5,arrive |
| j,h | Bischof-Kaller-Strasse,Bischof-Kaller-Strasse,Bischof-Kaller-Strasse | depart,roundabout-exit-5,arrive |
| n,m | , | depart,arrive |
@turboroundabout
# http://www.openstreetmap.org/?mlat=47.57723&mlon=7.796765&zoom=16#map=19/47.57720/7.79711

View File

@ -156,7 +156,7 @@ Feature: Turn Lane Guidance
When I route I should get
| waypoints | route | turns | lanes |
| a,d | road,turn,turn | depart,turn right,arrive | ,straight:false right:true, |
| a,c | road,road | depart,arrive | , |
| a,c | road,road | depart,arrive | ;straight:true right:false, |
Scenario: Turn with Bus-Lane Left
Given the node map
@ -178,7 +178,7 @@ Feature: Turn Lane Guidance
When I route I should get
| waypoints | route | turns | lanes |
| a,d | road,turn,turn | depart,turn left,arrive | ,left:true straight:false, |
| a,c | road,road | depart,arrive | , |
| a,c | road,road | depart,arrive | ;left:false straight:true, |
# This tests whether empty/invalid PSV tags cause osrm-extract to crash
Scenario: Turn with Bus-Lane
@ -248,23 +248,23 @@ Feature: Turn Lane Guidance
| fl | cross | | yes |
When I route I should get
| waypoints | route | turns | lanes |
| a,j | road,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true |
| a,d | road,road,road | depart,use lane straight,arrive | ,left:false straight:true right:false, |
| a,l | road,cross,cross | depart,turn left,arrive | ,left:true straight:false right:false, |
| a,h | road,road,road | depart,continue uturn,arrive | ,left:true straight:false right:false, |
| k,d | cross,road,road | depart,turn right,arrive | ,left:false straight;right:true, |
| k,l | cross,cross,cross | depart,use lane straight,arrive | ,left:false straight;right:true, |
| k,h | cross,road,road | depart,turn left,arrive | ,left:true straight;right:false, |
| k,j | cross,cross,cross | depart,continue uturn,arrive | ,left:true straight;right:false, |
| e,l | road,cross,cross | depart,turn right,arrive | ,none:false straight:false straight;right:true, |
| e,h | road,road | depart,arrive | ,none:false straight:true straight;right:true |
| e,j | road,cross,cross | depart,turn left,arrive | ,none:true straight:false straight;right:false, |
| e,d | road,road,road | depart,continue uturn,arrive | ,none:true straight:false straight;right:false, |
| i,h | cross,road,road | depart,turn right,arrive | ,, |
| i,j | cross,cross,cross | depart,use lane straight,arrive | ,left:false straight:true, |
| i,d | cross,road,road | depart,turn left,arrive | ,left:true straight:false, |
| i,l | cross,cross,cross | depart,continue uturn,arrive | ,left:true straight:false, |
| waypoints | route | turns | lanes | intersection_lanes |
| a,j | road,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true | ,left:false straight:false right:true |
| a,d | road,road | depart,arrive | , | left:false straight:true right:false, |
| a,l | road,cross,cross | depart,turn left,arrive | ,left:true straight:false right:false, | ,left:true straight:false right:false, |
| a,h | road,road,road | depart,continue uturn,arrive | ,left:true straight:false right:false, | ,left:true straight:false right:false |
| k,d | cross,road,road | depart,turn right,arrive | ,left:false straight;right:true, | ,left:false straight;right:true, |
| k,l | cross,cross | depart,arrive | , | left:false straight;right:true, |
| k,h | cross,road,road | depart,turn left,arrive | ,left:true straight;right:false, | ,left:true straight;right:false, |
| k,j | cross,cross,cross | depart,continue uturn,arrive | ,left:true straight;right:false, | ,left:true straight;right:false, |
| e,l | road,cross,cross | depart,turn right,arrive | ,none:false straight:false straight;right:true, | ,none:false straight:false straight;right:true, |
| e,h | road,road | depart,arrive | , | none:false straight:true straight;right:true, |
| e,j | road,cross,cross | depart,turn left,arrive | ,none:true straight:false straight;right:false, | ,none:true straight:false straight;right:false, |
| e,d | road,road,road | depart,continue uturn,arrive | ,none:true straight:false straight;right:false, | ,none:true straight:false straight;right:false, |
| i,h | cross,road,road | depart,turn right,arrive | ,, | |
| i,j | cross,cross | depart,arrive | | left:false straight:true, |
| i,d | cross,road,road | depart,turn left,arrive | ,left:true straight:false, | ,left:true straight:false, |
| i,l | cross,cross,cross | depart,continue uturn,arrive | ,left:true straight:false, | ,left:true straight:false, |
#copy of former case to prevent further regression
@collapse @partition-lanes
@ -295,13 +295,13 @@ Feature: Turn Lane Guidance
| fl | cross | | yes |
When I route I should get
| waypoints | route | turns | lanes |
| a,j | road,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
| k,d | cross,road,road | depart,turn right,arrive | ,left:false straight;right:true, |
| e,l | road,cross,cross | depart,turn right,arrive | ,none:false straight:false straight;right:true, |
| i,h | cross,road,road | depart,turn right,arrive | ,, |
| i,j | cross,cross | depart,arrive | , |
| i,l | cross,cross,cross | depart,continue uturn,arrive | ,left:true straight:false, |
| waypoints | route | turns | lanes |
| a,j | road,cross,cross | depart,turn right,arrive | ,left:false straight:false right:true, |
| k,d | cross,road,road | depart,turn right,arrive | ,left:false straight;right:true, |
| e,l | road,cross,cross | depart,turn right,arrive | ,none:false straight:false straight;right:true, |
| i,h | cross,road,road | depart,turn right,arrive | ,, |
| i,j | cross,cross | depart,arrive | ;;left:false straight:true, |
| i,l | cross,cross,cross | depart,continue uturn,arrive | ;,left:true straight:false;left:true straight:false;left:false straight:true, |
@partition-lanes
Scenario: Turn Lanes at Segregated Road
@ -347,7 +347,7 @@ Feature: Turn Lane Guidance
When I route I should get
| waypoints | route | turns | lanes |
| 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 | ;none:true right:false, |
@2654 @previous-lanes
Scenario: Turn Lanes Given earlier than actual turn
@ -368,11 +368,11 @@ Feature: Turn Lane Guidance
| hk | second-turn | | |
When I route I should get
| waypoints | route | turns | lanes |
| a,k | road,second-turn,second-turn | depart,turn right,arrive | ,none:false right:true, |
| a,i | road,road | depart,arrive | , |
| i,j | road,first-turn,first-turn | depart,turn left,arrive | ,left:true none:false, |
| i,a | road,road | depart,arrive | , |
| waypoints | route | turns | lanes |
| a,k | road,second-turn,second-turn | depart,turn right,arrive | ;,none:false right:true, |
| a,i | road,road | depart,arrive | ;;none:true right:false, |
| i,j | road,first-turn,first-turn | depart,turn left,arrive | ;,left:true none:false, |
| i,a | road,road | depart,arrive | ;;left:false none:true, |
@previous-lanes
Scenario: Passing a one-way street
@ -390,8 +390,8 @@ Feature: Turn Lane Guidance
| cf | turn | | |
When I route I should get
| waypoints | route | turns | lanes |
| a,f | road,turn,turn | depart,turn left,arrive | ,left:true straight:false, |
| waypoints | route | turns | lanes |
| a,f | road,turn,turn | depart,turn left,arrive | ;left:true straight:false,left:true straight:false, |
@partition-lanes
Scenario: Passing a one-way street, partly pulled back lanes
@ -411,10 +411,10 @@ Feature: Turn Lane Guidance
| bg | right | | no |
When I route I should get
| waypoints | route | turns | lanes |
| a,f | road,turn,turn | depart,turn left,arrive | ,left:true straight;right:false, |
| a,d | road,road | depart,arrive | , |
| a,g | road,right,right | depart,turn right,arrive | ,left:false straight;right:true, |
| waypoints | route | turns | lanes |
| a,f | road,turn,turn | depart,turn left,arrive | ;left:true straight;right:false,left:true straight;right:false, |
| a,d | road,road | depart,arrive | ;left:false straight;right:true;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
@ -434,9 +434,9 @@ Feature: Turn Lane Guidance
| bg | right | | no |
When I route I should get
| waypoints | route | turns | lanes |
| 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, |
| waypoints | route | turns | lanes |
| a,f | road,turn,turn | depart,turn left,arrive | ,left:true right:false;left:true right:false, |
| a,g | road,right,right | depart,turn right,arrive | ,left:false right:true, |
@todo @partition-lanes @previous-lanes
Scenario: Narrowing Turn Lanes
@ -484,7 +484,7 @@ Feature: Turn Lane Guidance
When I route I should get
| waypoints | route | turns | lanes |
| a,d | road,road | depart,arrive | , |
| a,d | road,road | depart,arrive | ;straight:true right:false, |
| a,e | road,turn,turn | depart,turn right,arrive | ,straight:false right:true, |
@todo @roundabout
@ -554,9 +554,9 @@ Feature: Turn Lane Guidance
| restriction | bc | dc | c | no_right_turn |
When I route I should get
| waypoints | route | turns | lanes |
| a,g | road,cross,cross | depart,turn left,arrive | ,left:true left:true straight:false straight:false right:false, |
| a,e | road,road | depart,arrive | , |
| waypoints | route | turns | lanes |
| a,g | road,cross,cross | depart,turn left,arrive | ,left:true left:true straight:false straight:false right:false;left:true left:true straight:false straight:false right:false, |
| a,e | road,road | depart,arrive | ;left:false left:false straight:true straight:true right:false;left:false left:false straight:true straight:true right:false, |
#NEEDS TO BE INVESTIGATED. Turn restriction shouldn't be here. See #2867
@reverse @previous-lanes
@ -589,11 +589,11 @@ Feature: Turn Lane Guidance
| restriction | de | ef | e | no_left_turn |
When I route I should get
| from | to | bearings | route | turns | lanes |
| a | g | 180,180 180,180 | road,cross,cross | depart,turn right,arrive | ,none:false straight:false right:true, |
| a | h | 180,180 180,180 | road,cross,cross | depart,turn left,arrive | ,none:true straight:false right:false, |
| 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, |
| from | to | bearings | route | turns | lanes |
| a | g | 180,180 180,180 | road,cross,cross | depart,turn right,arrive | ;none:false straight:false right:true,none:false straight:false right:true, |
| a | h | 180,180 180,180 | road,cross,cross | depart,turn left,arrive | ;none:true straight:false right:false,none:true straight:false right:false;, |
| a | i | 180,180 180,180 | road,road | depart,arrive | ;none:true straight:true right:false;none:true straight:true 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
@ -681,7 +681,7 @@ Feature: Turn Lane Guidance
When I route I should get
| waypoints | route | turns | lanes |
| a,d | road,road | depart,arrive | , |
| a,d | road,road | depart,arrive | ;straight:true straight:true straight;slight right:true slight right:false, |
| a,e | road,cross,cross | depart,turn slight right,arrive | ,straight:false straight:false straight;slight right:true slight right:true, |
@ramp
@ -700,7 +700,7 @@ Feature: Turn Lane Guidance
When I route I should get
| waypoints | route | turns | lanes |
| a,d | hwy,hwy | depart,arrive | , |
| a,d | hwy,hwy | depart,arrive | ;straight:true straight:true straight;slight right:true slight right:false, |
| a,e | hwy,ramp,ramp | depart,off ramp slight right,arrive | ,straight:false straight:false straight;slight right:true slight right:true, |
@todo
@ -745,7 +745,7 @@ Feature: Turn Lane Guidance
When I route I should get
| waypoints | route | turns | lanes |
| a,c | hwy,hwy | depart,arrive | , |
| a,c | hwy,hwy | depart,arrive | ;straight:true straight:true slight right:false, |
| a,d | hwy,ramp,ramp | depart,off ramp slight right,arrive | ,straight:false straight:false slight right:true, |
@reverse
@ -766,8 +766,8 @@ Feature: Turn Lane Guidance
| fgh | road | | primary | yes |
When I route I should get
| waypoints | route | turns | lanes |
| a,h | road,road,road | depart,continue uturn,arrive | ,uturn:true straight:false straight:false,|
| waypoints | route | turns | lanes |
| a,h | road,road,road | depart,continue uturn,arrive | ,uturn:true straight:false straight:false;,|
@reverse
Scenario: Reverse Lane in Segregated Road with none
@ -787,8 +787,8 @@ Feature: Turn Lane Guidance
| fgh | road | | primary | yes |
When I route I should get
| waypoints | route | turns | lanes |
| a,h | road,road,road | depart,continue uturn,arrive | ,uturn:true straight:false none:false, |
| waypoints | route | turns | lanes |
| 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
@ -810,8 +810,8 @@ Feature: Turn Lane Guidance
| ji | park | | service | no |
When I route I should get
| waypoints | route | turns | lanes |
| a,h | road,road,road | depart,continue uturn,arrive | ,uturn:true straight:false none:false, |
| waypoints | route | turns | lanes |
| 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
@ -873,9 +873,9 @@ Feature: Turn Lane Guidance
| ab | on | motorway_link | |
When I route I should get
| waypoints | route | turns | lanes |
| a,j | on,xbcj | depart,arrive | , |
| a,i | on,off,off | depart,turn right,arrive | ,none:false slight right:true, |
| waypoints | route | turns | lanes |
| a,j | on,xbcj | depart,arrive | ;;none:true slight right:false, |
| a,i | on,off,off | depart,turn right,arrive | ;,none:false slight right:true, |
#http://www.openstreetmap.org/#map=17/52.47414/13.35712
@todo @ramp @2645
@ -929,8 +929,8 @@ Feature: Turn Lane Guidance
| cf | turn | primary | |
When I route I should get
| waypoints | route | turns | lanes |
| x,d | road,road | depart,arrive | , |
| waypoints | route | turns | lanes |
| x,d | road,road | depart,arrive | ;straight;right:true;straight;right:true, |
@partition-lanes
Scenario: Partitioned turn, Slight Curve - maxspeed
@ -952,9 +952,9 @@ Feature: Turn Lane Guidance
| dce | cross | primary | yes | | 1 |
When I route I should get
| waypoints | route | turns | lanes | locations |
| a,g | road,cross,cross | depart,turn right,arrive | ,left:false right:true, | a,b,g |
| a,e | road,cross,cross | depart,end of road left,arrive | ,left:true right:false, | a,c,e |
| waypoints | route | turns | lanes | locations |
| a,g | road,cross,cross | depart,turn right,arrive | ,left:false right:true, | a,b,g |
| a,e | road,cross,cross | depart,end of road left,arrive | ;left:true right:false,left:true right:false, | a,c,e |
Scenario: Partitioned turn, Slight Curve
Given the node map
@ -975,9 +975,9 @@ Feature: Turn Lane Guidance
| dce | cross | primary | yes | |
When I route I should get
| waypoints | route | turns | lanes | locations |
| a,g | road,cross,cross | depart,turn right,arrive | ,left:false right:true, | a,b,g |
| a,e | road,cross,cross | depart,end of road left,arrive | ,left:true right:false, | a,c,e |
| waypoints | route | turns | lanes | locations |
| a,g | road,cross,cross | depart,turn right,arrive | ,left:false right:true, | a,b,g |
| a,e | road,cross,cross | depart,end of road left,arrive | ;left:true right:false,left:true right:false, | a,c,e |
Scenario: Lane Parsing Issue #2694
Given the node map
@ -1193,7 +1193,7 @@ Feature: Turn Lane Guidance
When I route I should get
| waypoints | route | turns | lanes |
| a,e | road,cross,cross | depart,turn right,arrive | ,left:false none:false none:true, |
| a,c | road,road | depart,arrive | , |
| a,c | road,road | depart,arrive | ;left:false none:true none:true, |
@3379
Scenario: Don't Turn through potential through lanes
@ -1214,7 +1214,7 @@ Feature: Turn Lane Guidance
When I route I should get
| waypoints | route | turns | lanes |
| a,d | road,cross,cross | depart,turn left,arrive | ,none:true none:false right:false, |
| a,c | road,road | depart,arrive | , |
| a,c | road,road | depart,arrive | ;none:true none:true right:false, |
@4189
Scenario: U-turn after a traffic light
@ -1242,5 +1242,5 @@ Feature: Turn Lane Guidance
| mdhk | road2 | 2 | | yes |
When I route I should get
| waypoints | route | turns | lanes | locations |
| a,f | road1,road1,road1 | depart,continue uturn,arrive | ,left:true straight:false straight;right:false, | a,d,f |
| waypoints | route | turns | lanes | locations |
| a,f | road1,road1,road1 | depart,continue uturn,arrive | ;left:false straight:true straight;right:false,left:true straight:false straight;right:false;;, | a,d,f |

View File

@ -171,6 +171,22 @@ module.exports = function () {
('out' in s.intersections[0] ? s.intersections[0].bearings[s.intersections[0].out] : 0));
};
this.lanesList = (instructions) => {
return this.extractInstructionList(instructions, s => {
return s.intersections.map( i => {
if(i.lanes == undefined )
return '';
else
{
return i.lanes.map( l => {
let indications = l.indications.join(';');
return indications + ':' + (l.valid ? 'true' : 'false');
}).join(' ');
}
}).join(';');
});
};
this.approachList = (instructions) => {
return this.extractInstructionList(instructions, s => s.approaches || '');
};
@ -197,17 +213,6 @@ module.exports = function () {
return instructions.tracepoints.map(t => t.alternatives_count.toString()).join(',');
};
this.lanesList = (instructions) => {
return this.extractInstructionList(instructions, instruction => {
if( 'lanes' in instruction.intersections[0] )
{
return instruction.intersections[0].lanes.map( p => { return (p.indications).join(';') + ':' + p.valid; } ).join(' ');
} else
{
return '';
}});
};
this.turnList = (instructions) => {
return instructions.legs.reduce((m, v) => m.concat(v.steps), [])
.map(v => {

View File

@ -174,14 +174,13 @@ class RouteAPI : public BaseAPI
guidance::trimShortSegments(steps, leg_geometry);
leg.steps = guidance::postProcess(std::move(steps));
leg.steps = guidance::collapseTurnInstructions(std::move(leg.steps));
leg.steps = guidance::anticipateLaneChange(std::move(leg.steps));
leg.steps = guidance::buildIntersections(std::move(leg.steps));
leg.steps = guidance::suppressShortNameSegments(std::move(leg.steps));
leg.steps = guidance::assignRelativeLocations(std::move(leg.steps),
leg_geometry,
phantoms.source_phantom,
phantoms.target_phantom);
leg.steps = guidance::anticipateLaneChange(std::move(leg.steps));
leg.steps = guidance::collapseUseLane(std::move(leg.steps));
leg_geometry = guidance::resyncGeometry(std::move(leg_geometry), leg.steps);
}

View File

@ -20,16 +20,6 @@ namespace guidance
OSRM_ATTR_WARN_UNUSED
std::vector<RouteStep> suppressShortNameSegments(std::vector<RouteStep> steps);
// remove use lane information that is not actually a turn. For post-processing, we need to
// associate lanes with every turn. Some of these use-lane instructions are not required after lane
// anticipation anymore. This function removes all use lane instructions that are not actually used
// anymore since all lanes going straight are used anyhow.
// FIXME this is currently only a heuristic. We need knowledge on which lanes actually might become
// turn lanes. If a straight lane becomes a turn lane, this might be something to consider. Right
// now we bet on lane-anticipation to catch this.
OSRM_ATTR_WARN_UNUSED
std::vector<RouteStep> collapseUseLane(std::vector<RouteStep> steps);
} // namespace guidance
} // namespace engine
} // namespace osrm

View File

@ -207,7 +207,9 @@ inline bool isSilent(const extractor::guidance::TurnInstruction instruction)
{
return instruction.type == extractor::guidance::TurnType::NoTurn ||
instruction.type == extractor::guidance::TurnType::Suppressed ||
instruction.type == extractor::guidance::TurnType::StayOnRoundabout;
instruction.type == extractor::guidance::TurnType::StayOnRoundabout ||
// it is enough to output them within the intersections array
instruction.type == extractor::guidance::TurnType::UseLane;
}
inline bool hasRampType(const extractor::guidance::TurnInstruction instruction)

View File

@ -608,7 +608,7 @@ std::vector<RouteStep> buildIntersections(std::vector<RouteStep> steps)
{
auto &step = steps[step_index];
const auto instruction = step.maneuver.instruction;
if (instruction.type == TurnType::Suppressed)
if (instruction.type == TurnType::Suppressed || instruction.type == TurnType::UseLane)
{
BOOST_ASSERT(steps[last_valid_instruction].mode == step.mode);
// count intersections. We cannot use exit, since intersections can follow directly

View File

@ -82,52 +82,6 @@ std::vector<RouteStep> suppressShortNameSegments(std::vector<RouteStep> steps)
return removeNoTurnInstructions(std::move(steps));
}
// `useLane` steps are only returned on `straight` maneuvers when there
// are surrounding lanes also tagged as `straight`. If there are no other `straight`
// lanes, it is not an ambiguous maneuver, and we can collapse the `useLane` step.
std::vector<RouteStep> collapseUseLane(std::vector<RouteStep> steps)
{
const auto containsTag = [](const extractor::guidance::TurnLaneType::Mask mask,
const extractor::guidance::TurnLaneType::Mask tag) {
return (mask & tag) != extractor::guidance::TurnLaneType::empty;
};
const auto canCollapseUseLane = [containsTag](const RouteStep &step) {
// the lane description is given left to right, lanes are counted from the right.
// Therefore we access the lane description using the reverse iterator
auto right_most_lanes = step.LanesToTheRight();
if (!right_most_lanes.empty() && containsTag(right_most_lanes.front(),
(extractor::guidance::TurnLaneType::straight |
extractor::guidance::TurnLaneType::none)))
return false;
auto left_most_lanes = step.LanesToTheLeft();
if (!left_most_lanes.empty() && containsTag(left_most_lanes.back(),
(extractor::guidance::TurnLaneType::straight |
extractor::guidance::TurnLaneType::none)))
return false;
return true;
};
BOOST_ASSERT(steps.size() > 1);
for (auto step_itr = steps.begin() + 1; step_itr != steps.end(); ++step_itr)
{
if (step_itr->maneuver.instruction.type == TurnType::UseLane &&
canCollapseUseLane(*step_itr))
{
auto previous_turn_itr = findPreviousTurn(step_itr);
if (haveSameMode(*previous_turn_itr, *step_itr))
{
previous_turn_itr->ElongateBy(*step_itr);
step_itr->Invalidate();
}
}
}
return removeNoTurnInstructions(std::move(steps));
}
} // namespace guidance
} // namespace engine
} // namespace osrm