modify turn angles and instructions

This commit is contained in:
Moritz Kobitzsch
2016-01-29 12:42:08 +01:00
parent ab9426e260
commit f14352f494
18 changed files with 936 additions and 230 deletions
+2 -2
View File
@@ -36,5 +36,5 @@ Feature: Basic Routing
| fy | last |
When I route I should get
| from | to | route | turns |
| x | y | first,compr,last | head,right,left,destination |
| from | to | route | turns |
| x | y | first,compr,last | head,straight,straight,destination |
+3 -3
View File
@@ -92,6 +92,6 @@ Feature: Avoid weird loops caused by rounding errors
| cf | primary |
When I route I should get
| waypoints | route | turns |
| a,2,d | ab,be,ef,ef,cf,cd | head,left,right,via,right,left,destination |
| a,1,d | ab,be,ef,ef,cf,cd | head,left,right,via,right,left,destination |
| waypoints | route | turns |
| a,2,d | ab,be,ef,ef,cf,cd | head,left,straight,via,straight,left,destination |
| a,1,d | ab,be,ef,ef,cf,cd | head,left,straight,via,straight,left,destination |
+1 -17
View File
@@ -17,21 +17,13 @@ Feature: Turn directions/codes
And the ways
| nodes |
| xa |
| xb |
| xc |
| xd |
| xe |
| xf |
| xg |
| xh |
| xi |
| xj |
| xk |
| xl |
| xm |
| xn |
| xo |
| xp |
When I match I should get
| trace | route | turns | matchings |
@@ -40,7 +32,7 @@ Feature: Turn directions/codes
| ia | xi,xa | head,straight,destination | ia |
| ic | xi,xc | head,slight_right,destination | ic |
| ie | xi,xe | head,right,destination | ie |
| ko | xk,xo | head,left,destination | ko |
| ka | xk,xa | head,slight_left,destination | ka |
| kc | xk,xc | head,straight,destination | kc |
@@ -96,21 +88,13 @@ Feature: Turn directions/codes
And the ways
| nodes |
| xa |
| xb |
| xc |
| xd |
| xe |
| xf |
| xg |
| xh |
| xi |
| xj |
| xk |
| xl |
| xm |
| xn |
| xo |
| xp |
When I match I should get
| trace | route | turns | matchings | duration |
+8 -8
View File
@@ -174,14 +174,14 @@ Feature: Testbot - Travel mode
| ef | primary | | |
When I route I should get
| from | to | route | turns | modes |
| a | d | ab,bc,cd | head,right,left,destination | 1,2,1 |
| d | a | cd,bc,ab | head,right,left,destination | 1,2,1 |
| c | a | bc,ab | head,left,destination | 2,1 |
| d | b | cd,bc | head,right,destination | 1,2 |
| a | c | ab,bc | head,right,destination | 1,2 |
| b | d | bc,cd | head,left,destination | 2,1 |
| a | f | ab,bc,cd,de,ef | head,right,left,straight,straight,destination | 1,2,1,1,1 |
| from | to | route | turns | modes |
| a | d | ab,bc,cd | head,right,left,destination | 1,2,1 |
| d | a | cd,bc,ab | head,right,left,destination | 1,2,1 |
| c | a | bc,ab | head,left,destination | 2,1 |
| d | b | cd,bc | head,right,destination | 1,2 |
| a | c | ab,bc | head,right,destination | 1,2 |
| b | d | bc,cd | head,left,destination | 2,1 |
| a | f | ab,bc,cd,de,ef | head,right,left,straight,straight,destination | 1,2,1,1,1 |
Scenario: Testbot - Modes, triangle map
Given the node map
+6 -6
View File
@@ -21,13 +21,13 @@ Feature: POST request
| bc |
| xy |
| yz |
When I route I should get
| from | to | route | turns |
| a | c | ab,bc | head,left,destination |
| c | a | bc,ab | head,right,destination |
| x | z | xy,yz | head,right,destination |
| z | x | yz,xy | head,left,destination |
| from | to | route | turns |
| a | c | ab,bc | head,straight,destination |
| c | a | bc,ab | head,straight,destination |
| x | z | xy,yz | head,straight,destination |
| z | x | yz,xy | head,straight,destination |
Scenario: Testbot - match POST request
Given a grid size of 10 meters
+74
View File
@@ -0,0 +1,74 @@
@routing @testbot @via
Feature: Via points
Background:
Given the profile "testbot"
And a grid size of 4 meters
Scenario: Basic Right Turn
Given the node map
| a | b | c | d | e | f | g |
| | | | | | h | |
| | | | | | i | |
| | | | | | j | |
| | | | | | k | |
And the ways
| nodes | oneway |
| abcdefg | yes |
| ehijk | yes |
When I route I should get
| from | to | route | distance | turns |
| a | k | abcdefg,ehijk | 34m +-1 | head,right,destination |
Scenario: Slight Turn
Given the node map
| a | b | c | d | e | f | g | |
| | | | | | h | i | |
| | | | | | | | j |
| | | | | | | | k |
And the ways
| nodes | oneway |
| abcdefg | yes |
| ehijk | yes |
When I route I should get
| from | to | route | distance | turns |
| a | k | abcdefg,ehijk | 34m +-1 | head,slight_right,destination |
Scenario: Nearly Slight Turn
Given the node map
| a | b | c | d | e | f | g | |
| | | | | | h | | |
| | | | | | | i | |
| | | | | | | | j |
| | | | | | | | k |
And the ways
| nodes | oneway |
| abcdefg | yes |
| ehijk | yes |
When I route I should get
| from | to | route | distance | turns |
| a | k | abcdefg,ehijk | 37m +-1 | head,right,destination |
Scenario: Nearly Slight Turn (Variation)
Given the node map
| a | b | c | d | e | f | g | |
| | | | | | h | | |
| | | | | | | i | |
| | | | | | | j | |
| | | | | | | | k |
And the ways
| nodes | oneway |
| abcdefg | yes |
| ehijk | yes |
When I route I should get
| from | to | route | distance | turns |
| a | k | abcdefg,ehijk | 37m +-1 | head,right,destination |
+9 -17
View File
@@ -14,22 +14,14 @@ Feature: Turn directions/codes
And the ways
| nodes |
| xa |
| xb |
| xc |
| xd |
| xe |
| xf |
| xg |
| xh |
| xi |
| xj |
| xk |
| xl |
| xm |
| xn |
| xo |
| xp |
| xa |
| xc |
| xe |
| xg |
When I route I should get
| from | to | route | turns |
@@ -116,8 +108,8 @@ Feature: Turn directions/codes
| yz |
When I route I should get
| from | to | route | turns |
| a | c | ab,bc | head,left,destination |
| c | a | bc,ab | head,right,destination |
| x | z | xy,yz | head,right,destination |
| z | x | yz,xy | head,left,destination |
| from | to | route | turns |
| a | c | ab,bc | head,straight,destination |
| c | a | bc,ab | head,straight,destination |
| x | z | xy,yz | head,straight,destination |
| z | x | yz,xy | head,straight,destination |
+2 -2
View File
@@ -20,8 +20,8 @@ Feature: U-turns at via points
| fg |
When I route I should get
| waypoints | route | turns |
| a,e,c | ab,be,be,ef,fg,dg,cd | head,right,via,left,straight,left,left,destination |
| waypoints | route | turns |
| a,e,c | ab,be,be,ef,fg,dg,cd | head,right,via,straight,straight,straight,straight,destination |
Scenario: Query param to allow U-turns at all via points
Given the node map
+21 -21
View File
@@ -86,12 +86,12 @@ Feature: Via points
| fa | yes |
When I route I should get
| waypoints | route | distance | turns |
| 1,3 | ab,bc,cd | 400m +-1 | head,straight,straight,destination |
| 3,1 | cd,de,ef,fa,ab | 1000m +-1 | head,right,right,right,right,destination |
| 1,2,3 | ab,bc,bc,cd | 400m +-1 | head,straight,via,straight,destination |
| 1,3,2 | ab,bc,cd,cd,de,ef,fa,ab,bc | 1600m +-1 | head,straight,straight,via,right,right,right,right,straight,destination |
| 3,2,1 | cd,de,ef,fa,ab,bc,bc,cd,de,ef,fa,ab | 2400m +-1 | head,right,right,right,right,straight,via,straight,right,right,right,right,destination |
| waypoints | route | distance | turns |
| 1,3 | ab,bc,cd | 400m +-1 | head,straight,straight,destination |
| 3,1 | cd,de,ef,fa,ab | 1000m +-1 | head,straight,straight,straight,right,destination |
| 1,2,3 | ab,bc,bc,cd | 400m +-1 | head,straight,via,straight,destination |
| 1,3,2 | ab,bc,cd,cd,de,ef,fa,ab,bc | 1600m +-1 | head,straight,straight,via,straight,straight,straight,right,straight,destination |
| 3,2,1 | cd,de,ef,fa,ab,bc,bc,cd,de,ef,fa,ab | 2400m +-1 | head,straight,straight,straight,right,straight,via,straight,straight,straight,straight,right,destination |
Scenario: Via points on ring on the same oneway
# xa it to avoid only having a single ring, which cna trigger edge cases
@@ -109,12 +109,12 @@ Feature: Via points
| da | yes |
When I route I should get
| waypoints | route | distance | turns |
| 1,3 | ab | 200m +-1 | head,destination |
| 3,1 | ab,bc,cd,da,ab | 800m +-1 | head,right,right,right,right,destination |
| 1,2,3 | ab,ab | 200m +-1 | head,via,destination |
| 1,3,2 | ab,ab,bc,cd,da,ab | 1100m +-1 | head,via,right,right,right,right,destination |
| 3,2,1 | ab,bc,cd,da,ab,ab,bc,cd,da,ab | 1800m | head,right,right,right,right,via,right,right,right,right,destination |
| waypoints | route | distance | turns |
| 1,3 | ab | 200m +-1 | head,destination |
| 3,1 | ab,bc,cd,da,ab | 800m +-1 | head,straight,straight,straight,right,destination |
| 1,2,3 | ab,ab | 200m +-1 | head,via,destination |
| 1,3,2 | ab,ab,bc,cd,da,ab | 1100m +-1 | head,via,straight,straight,straight,right,destination |
| 3,2,1 | ab,bc,cd,da,ab,ab,bc,cd,da,ab | 1800m | head,straight,straight,straight,right,via,straight,straight,straight,right,destination |
# See issue #1896
Scenario: Via point at a dead end with oneway
@@ -175,11 +175,11 @@ Feature: Via points
| da | yes |
When I route I should get
| waypoints | route | distance | turns |
| 2,1 | ab,bc,cd,da,ab | 1100m +-1 | head,right,right,right,right,destination |
| 4,3 | bc,cd,da,ab,bc | 1100m +-1 | head,right,right,right,right,destination |
| 6,5 | cd,da,ab,bc,cd | 1100m +-1 | head,right,right,right,right,destination |
| 8,7 | da,ab,bc,cd,da | 1100m +-1 | head,right,right,right,right,destination |
| waypoints | route | distance | turns |
| 2,1 | ab,bc,cd,da,ab | 1100m +-1 | head,straight,straight,straight,straight,destination |
| 4,3 | bc,cd,da,ab,bc | 1100m +-1 | head,straight,straight,straight,straight,destination |
| 6,5 | cd,da,ab,bc,cd | 1100m +-1 | head,straight,straight,straight,straight,destination |
| 8,7 | da,ab,bc,cd,da | 1100m +-1 | head,straight,straight,straight,straight,destination |
Scenario: Multiple Via points on ring on the same oneway, forces one of the vertices to be top node
Given the node map
@@ -197,7 +197,7 @@ Feature: Via points
| da | yes |
When I route I should get
| waypoints | route | distance | turns |
| 3,2,1 | ab,bc,cd,da,ab,ab,bc,cd,da,ab | 3000m +-1 | head,right,right,right,right,via,right,right,right,right,destination |
| 6,5,4 | bc,cd,da,ab,bc,bc,cd,da,ab,bc | 3000m +-1 | head,right,right,right,right,via,right,right,right,right,destination |
| 9,8,7 | cd,da,ab,bc,cd,cd,da,ab,bc,cd | 3000m +-1 | head,right,right,right,right,via,right,right,right,right,destination |
| waypoints | route | distance | turns |
| 3,2,1 | ab,bc,cd,da,ab,ab,bc,cd,da,ab | 3000m +-1 | head,straight,straight,straight,straight,via,straight,straight,straight,straight,destination |
| 6,5,4 | bc,cd,da,ab,bc,bc,cd,da,ab,bc | 3000m +-1 | head,straight,straight,straight,straight,via,straight,straight,straight,straight,destination |
| 9,8,7 | cd,da,ab,bc,cd,cd,da,ab,bc,cd | 3000m +-1 | head,straight,straight,straight,straight,via,straight,straight,straight,straight,destination |