diff --git a/features/guidance/intersections.feature b/features/guidance/intersections.feature index b276ee77f..e73021402 100644 --- a/features/guidance/intersections.feature +++ b/features/guidance/intersections.feature @@ -17,8 +17,8 @@ Feature: Intersections Data | bd | corner | When I route I should get - | waypoints | route | turns | intersections | - | a,c | through,through | depart,arrive | true:90 true:270,true:90 true:180 false:270;true:90 true:270 | + | waypoints | route | turns | intersections | + | a,c | through,through | depart,arrive | true:90,true:90 true:180 false:270;true:270 | Scenario: Passing Three Way North Given the node map @@ -32,8 +32,8 @@ Feature: Intersections Data | bd | corner | When I route I should get - | waypoints | route | turns | intersections | - | a,c | through,through | depart,arrive | true:90 true:270,true:0 true:90 false:270;true:90 true:270 | + | waypoints | route | turns | intersections | + | a,c | through,through | depart,arrive | true:90,true:0 true:90 false:270;true:270 | Scenario: Passing Oneway Street In Given the node map @@ -47,8 +47,8 @@ Feature: Intersections Data | db | corner | yes | When I route I should get - | waypoints | route | turns | intersections | - | a,c | through,through | depart,arrive | true:90 true:270,false:0 true:90 false:270;true:90 true:270 | + | waypoints | route | turns | intersections | + | a,c | through,through | depart,arrive | true:90,false:0 true:90 false:270;true:270 | Scenario: Passing Oneway Street Out Given the node map @@ -62,8 +62,8 @@ Feature: Intersections Data | bd | corner | yes | When I route I should get - | waypoints | route | turns | intersections | - | a,c | through,through | depart,arrive | true:90 true:270,true:0 true:90 false:270;true:90 true:270 | + | waypoints | route | turns | intersections | + | a,c | through,through | depart,arrive | true:90,true:0 true:90 false:270;true:270 | Scenario: Passing Two Intersections Given the node map @@ -80,8 +80,8 @@ Feature: Intersections Data | cf | corner | When I route I should get - | waypoints | route | turns | intersections | - | a,d | through,through | depart,arrive | true:90 true:270,true:0 true:90 false:270,true:90 true:180 false:270;true:90 true:270 | + | waypoints | route | turns | intersections | + | a,d | through,through | depart,arrive | true:90,true:0 true:90 false:270,true:90 true:180 false:270;true:270 | Scenario: Passing Two Intersections, Collapsing Given the node map @@ -98,9 +98,9 @@ Feature: Intersections Data | cf | corner | When I route I should get - | waypoints | route | turns | intersections | - | a,d | through,through | depart,arrive | true:90 true:270,true:0 true:90 false:270,true:90 true:180 false:270;true:90 true:270 | - | f,a | corner,throughbridge,through | depart,end of road left,arrive | true:0 true:180;true:90 false:180 true:270,true:0 false:90 true:270;true:90 true:270 | + | waypoints | route | turns | intersections | + | a,d | through,through | depart,arrive | true:90,true:0 true:90 false:270,true:90 true:180 false:270;true:270 | + | f,a | corner,throughbridge,through | depart,end of road left,arrive | true:0;true:90 false:180 true:270,true:0 false:90 true:270;true:90 | Scenario: Roundabouts Given the node map @@ -126,9 +126,9 @@ Feature: Intersections Data When I route I should get | waypoints | route | turns | intersections | - | e,f | ea,fb,fb | depart,abcda-exit-1,arrive | true:0 true:180;false:0 false:150 true:210,false:30 true:150 true:270;true:90 true:270 | - | e,g | ea,gc,gc | depart,abcda-exit-2,arrive | true:0 true:180;false:0 false:150 true:210,false:30 true:150 true:270,true:30 true:180 false:330;true:0 true:180 | - | e,h | ea,hd,hd | depart,abcda-exit-3,arrive | true:0 true:180;false:0 false:150 true:210,false:30 true:150 true:270,true:30 true:180 false:330,true:90 false:210 true:330;true:90 true:270 | - | e,2 | ea,abcda,abcda | depart,abcda-exit-undefined,arrive | true:0 true:180;false:0 false:150 true:210,false:30 true:150 true:270;true:146 false:326 | - | 1,g | abcda,gc,gc | depart,abcda-exit-2,arrive | false:34 true:214;false:34 true:214,false:30 true:150 true:270,true:30 true:180 false:330;true:0 true:180 | - | 1,3 | abcda,abcda | depart,arrive | false:34 true:214,false:30 true:150 true:270,true:30 true:180 false:330;true:34 false:214 | + | e,f | ea,fb,fb | depart,abcda-exit-1,arrive | true:180;false:0 false:150 true:210,false:30 true:150 true:270;true:90 | + | e,g | ea,gc,gc | depart,abcda-exit-2,arrive | true:180;false:0 false:150 true:210,false:30 true:150 true:270,true:30 true:180 false:330;true:0 | + | e,h | ea,hd,hd | depart,abcda-exit-3,arrive | true:180;false:0 false:150 true:210,false:30 true:150 true:270,true:30 true:180 false:330,true:90 false:210 true:330;true:270 | + | e,2 | ea,abcda,abcda | depart,abcda-exit-undefined,arrive | true:180;false:0 false:150 true:210,false:30 true:150 true:270;true:326 | + | 1,g | abcda,gc,gc | depart,abcda-exit-2,arrive | true:214;true:214,false:30 true:150 true:270,true:30 true:180 false:330;true:0 | + | 1,3 | abcda,abcda | depart,arrive | true:214,false:30 true:150 true:270,true:30 true:180 false:330;true:214 | diff --git a/features/support/route.js b/features/support/route.js index 4903ecf2e..b9c868301 100644 --- a/features/support/route.js +++ b/features/support/route.js @@ -138,9 +138,7 @@ module.exports = function () { }; this.bearingList = (instructions) => { - return this.extractInstructionList(instructions, s => (typeof s.intersections[0].out !== 'undefined') - ? s.intersections[0].bearings[s.intersections[0].out] - : 0); + return this.extractInstructionList(instructions, s => s.maneuver.bearing_before + '->' + s.maneuver.bearing_after); }; this.annotationList = (instructions) => { diff --git a/features/testbot/bearing.feature b/features/testbot/bearing.feature index 76a2819af..b8aa4936e 100644 --- a/features/testbot/bearing.feature +++ b/features/testbot/bearing.feature @@ -14,8 +14,8 @@ Feature: Compass bearing | ab | When I route I should get - | from | to | route | bearing | - | a | b | ab,ab | 315,0 | + | from | to | route | bearing | + | a | b | ab,ab | 0->315,315->0| Scenario: Bearing when going west Given the node map @@ -26,8 +26,8 @@ Feature: Compass bearing | ab | When I route I should get - | from | to | route | bearing | - | a | b | ab,ab | 270,0 | + | from | to | route | bearing | + | a | b | ab,ab | 0->270,270->0| Scenario: Bearing af 45 degree intervals Given the node map @@ -48,14 +48,14 @@ Feature: Compass bearing When I route I should get | from | to | route | bearing | - | x | a | xa,xa | 0,0 | - | x | b | xb,xb | 315,0 | - | x | c | xc,xc | 270,0 | - | x | d | xd,xd | 225,0 | - | x | e | xe,xe | 180,0 | - | x | f | xf,xf | 135,0 | - | x | g | xg,xg | 90,0 | - | x | h | xh,xh | 45,0 | + | x | a | xa,xa | 0->0,0->0| + | x | b | xb,xb | 0->315,315->0| + | x | c | xc,xc | 0->270,270->0| + | x | d | xd,xd | 0->225,225->0| + | x | e | xe,xe | 0->180,180->0| + | x | f | xf,xf | 0->135,135->0| + | x | g | xg,xg | 0->90,90->0| + | x | h | xh,xh | 0->45,45->0| Scenario: Bearing in a roundabout Given the node map @@ -76,9 +76,9 @@ Feature: Compass bearing | ha | yes | When I route I should get - | from | to | route | bearing | - | c | b | cd,de,ef,fg,gh,ha,ab,ab | 270,225,180,135,90,45,0,0 | - | g | f | gh,ha,ab,bc,cd,de,ef,ef | 90,45,0,315,270,225,180,0 | + | from | to | route | bearing | + | c | b | cd,de,ef,fg,gh,ha,ab,ab | 0->270,270->225,225->180,180->135,135->90,90->45,45->0,0->0 | + | g | f | gh,ha,ab,bc,cd,de,ef,ef | 0->90,90->45,45->0,0->315,315->270,270->225,225->180,180->0 | Scenario: Bearing should stay constant when zig-zagging Given the node map @@ -97,7 +97,7 @@ Feature: Compass bearing When I route I should get | from | to | route | bearing | - | a | h | ab,bc,cd,de,ef,fg,gh,gh | 0,135,0,135,0,135,0,0 | + | a | h | ab,bc,cd,de,ef,fg,gh,gh | 0->0,0->135,135->0,0->135,135->0,0->135,135->0,0->0 | Scenario: Bearings on an east-west way. Given the node map @@ -108,37 +108,37 @@ Feature: Compass bearing | abcdef | When I route I should get - | from | to | route | bearing | - | a | b | abcdef,abcdef | 90,0 | - | a | c | abcdef,abcdef | 90,0 | - | a | d | abcdef,abcdef | 90,0 | - | a | e | abcdef,abcdef | 90,0 | - | a | f | abcdef,abcdef | 90,0 | - | b | a | abcdef,abcdef | 270,0 | - | b | c | abcdef,abcdef | 90,0 | - | b | d | abcdef,abcdef | 90,0 | - | b | e | abcdef,abcdef | 90,0 | - | b | f | abcdef,abcdef | 90,0 | - | c | a | abcdef,abcdef | 270,0 | - | c | b | abcdef,abcdef | 270,0 | - | c | d | abcdef,abcdef | 90,0 | - | c | e | abcdef,abcdef | 90,0 | - | c | f | abcdef,abcdef | 90,0 | - | d | a | abcdef,abcdef | 270,0 | - | d | b | abcdef,abcdef | 270,0 | - | d | c | abcdef,abcdef | 270,0 | - | d | e | abcdef,abcdef | 90,0 | - | d | f | abcdef,abcdef | 90,0 | - | e | a | abcdef,abcdef | 270,0 | - | e | b | abcdef,abcdef | 270,0 | - | e | c | abcdef,abcdef | 270,0 | - | e | d | abcdef,abcdef | 270,0 | - | e | f | abcdef,abcdef | 90,0 | - | f | a | abcdef,abcdef | 270,0 | - | f | b | abcdef,abcdef | 270,0 | - | f | c | abcdef,abcdef | 270,0 | - | f | d | abcdef,abcdef | 270,0 | - | f | e | abcdef,abcdef | 270,0 | + | from | to | route | bearing | + | a | b | abcdef,abcdef | 0->90,90->0 | + | a | c | abcdef,abcdef | 0->90,90->0 | + | a | d | abcdef,abcdef | 0->90,90->0 | + | a | e | abcdef,abcdef | 0->90,90->0 | + | a | f | abcdef,abcdef | 0->90,90->0 | + | b | a | abcdef,abcdef | 0->270,270->0 | + | b | c | abcdef,abcdef | 0->90,90->0 | + | b | d | abcdef,abcdef | 0->90,90->0 | + | b | e | abcdef,abcdef | 0->90,90->0 | + | b | f | abcdef,abcdef | 0->90,90->0 | + | c | a | abcdef,abcdef | 0->270,270->0 | + | c | b | abcdef,abcdef | 0->270,270->0 | + | c | d | abcdef,abcdef | 0->90,90->0 | + | c | e | abcdef,abcdef | 0->90,90->0 | + | c | f | abcdef,abcdef | 0->90,90->0 | + | d | a | abcdef,abcdef | 0->270,270->0 | + | d | b | abcdef,abcdef | 0->270,270->0 | + | d | c | abcdef,abcdef | 0->270,270->0 | + | d | e | abcdef,abcdef | 0->90,90->0 | + | d | f | abcdef,abcdef | 0->90,90->0 | + | e | a | abcdef,abcdef | 0->270,270->0 | + | e | b | abcdef,abcdef | 0->270,270->0 | + | e | c | abcdef,abcdef | 0->270,270->0 | + | e | d | abcdef,abcdef | 0->270,270->0 | + | e | f | abcdef,abcdef | 0->90,90->0 | + | f | a | abcdef,abcdef | 0->270,270->0 | + | f | b | abcdef,abcdef | 0->270,270->0 | + | f | c | abcdef,abcdef | 0->270,270->0 | + | f | d | abcdef,abcdef | 0->270,270->0 | + | f | e | abcdef,abcdef | 0->270,270->0 | Scenario: Bearings at high latitudes # The coordinas below was calculated using http://www.movable-type.co.uk/scripts/latlong.html, @@ -161,19 +161,19 @@ Feature: Compass bearing | bd | When I route I should get - | from | to | route | bearing | - | a | b | ab,ab | 0,0 | - | b | c | bc,bc | 90,0 | - | c | d | cd,cd | 180,0 | - | d | a | da,da | 270,0 | - | b | a | ab,ab | 180,0 | - | c | b | bc,bc | 270,0 | - | d | c | cd,cd | 0,0 | - | a | d | da,da | 90,0 | - | a | c | ac,ac | 45,0 | - | c | a | ac,ac | 225,0 | - | b | d | bd,bd | 135,0 | - | d | b | bd,bd | 315,0 | + | from | to | route | bearing | + | a | b | ab,ab | 0->0,0->0 | + | b | c | bc,bc | 0->90,90->0 | + | c | d | cd,cd | 0->180,180->0 | + | d | a | da,da | 0->270,270->0 | + | b | a | ab,ab | 0->180,180->0 | + | c | b | bc,bc | 0->270,270->0 | + | d | c | cd,cd | 0->0,0->0 | + | a | d | da,da | 0->90,90->0 | + | a | c | ac,ac | 0->45,45->0 | + | c | a | ac,ac | 0->225,225->0 | + | b | d | bd,bd | 0->135,135->0 | + | d | b | bd,bd | 0->315,315->0 | Scenario: Bearings at high negative latitudes # The coordinas below was calculated using http://www.movable-type.co.uk/scripts/latlong.html, @@ -196,16 +196,16 @@ Feature: Compass bearing | bd | When I route I should get - | from | to | route | bearing | - | a | b | ab,ab | 180,0 | - | b | c | bc,bc | 90,0 | - | c | d | cd,cd | 0,0 | - | d | a | da,da | 270,0 | - | b | a | ab,ab | 0,0 | - | c | b | bc,bc | 270,0 | - | d | c | cd,cd | 180,0 | - | a | d | da,da | 90,0 | - | a | c | ac,ac | 135,0 | - | c | a | ac,ac | 315,0 | - | b | d | bd,bd | 45,0 | - | d | b | bd,bd | 225,0 | + | from | to | route | bearing | + | a | b | ab,ab | 0->180,180->0 | + | b | c | bc,bc | 0->90,90->0 | + | c | d | cd,cd | 0->0,0->0 | + | d | a | da,da | 0->270,270->0 | + | b | a | ab,ab | 0->0,0->0 | + | c | b | bc,bc | 0->270,270->0 | + | d | c | cd,cd | 0->180,180->0 | + | a | d | da,da | 0->90,90->0 | + | a | c | ac,ac | 0->135,135->0 | + | c | a | ac,ac | 0->315,315->0 | + | b | d | bd,bd | 0->45,45->0 | + | d | b | bd,bd | 0->225,225->0 | diff --git a/features/testbot/bearing_param.feature b/features/testbot/bearing_param.feature index ea60856f0..523590738 100644 --- a/features/testbot/bearing_param.feature +++ b/features/testbot/bearing_param.feature @@ -15,11 +15,11 @@ Feature: Bearing parameter When I route I should get | from | to | bearings | route | bearing | - | b | c | 90 90 | ad,ad | 90,0 | + | b | c | 90 90 | ad,ad | 0->90,90->0| | b | c | 180 90 | | | - | b | c | 80 100 | ad,ad | 90,0 | + | b | c | 80 100 | ad,ad | 0->90,90->0| | b | c | 79 100 | | | - | b | c | 79,11 100 | ad,ad | 90,0 | + | b | c | 79,11 100 | ad,ad | 0->90,90->0| Scenario: Testbot - Intial bearing in simple case Given the node map @@ -35,10 +35,10 @@ Feature: Bearing parameter When I route I should get | from | to | bearings | route | bearing | | 0 | c | 0 0 | | | - | 0 | c | 45 45 | bc,bc | 45 ~3% | + | 0 | c | 45 45 | bc,bc | 0->45,45->0| | 0 | c | 85 85 | | | | 0 | c | 95 95 | | | - | 0 | c | 135 135 | ac,ac | 135 ~1% | + | 0 | c | 135 135 | ac,ac | 0->136,136->0 | | 0 | c | 180 180 | | | Scenario: Testbot - Initial bearing on split way @@ -55,19 +55,19 @@ Feature: Bearing parameter When I route I should get | from | to | bearings | route | bearing | - | 0 | b | 10 10 | bc,bc | 0,0 | - | 0 | b | 90 90 | ab,ab | 90,0 | + | 0 | b | 10 10 | bc,bc | 0->0,0->0 | + | 0 | b | 90 90 | ab,ab | 0->90,90->0 | # The returned bearing is wrong here, it's based on the snapped # coordinates, not the acutal edge bearing. This should be # fixed one day, but it's only a problem when we snap two vias # to the same point - DP #| 0 | b | 170 170 | da | 180 | #| 0 | b | 189 189 | da | 180 | - | 0 | 1 | 90 270 | ab,bc,cd,cd | 90,0,270,0 | - | 1 | d | 10 10 | bc,bc | 0,0 | - | 1 | d | 90 90 | ab,bc,cd,da,da | 90,0,270,180,0 | - | 1 | 0 | 189 189 | da,da | 180,0 | - | 1 | d | 270 270 | cd,cd | 270,0 | + | 0 | 1 | 90 270 | ab,bc,cd,cd | 0->90,90->0,0->270,270->0 | + | 1 | d | 10 10 | bc,bc | 0->0,0->0 | + | 1 | d | 90 90 | ab,bc,cd,da,da | 0->90,90->0,0->270,270->180,180->0 | + | 1 | 0 | 189 189 | da,da | 0->180,180->0 | + | 1 | d | 270 270 | cd,cd | 0->270,270->0 | | 1 | d | 349 349 | | | Scenario: Testbot - Initial bearing in all direction @@ -101,11 +101,11 @@ Feature: Bearing parameter When I route I should get | from | to | bearings | route | bearing | - | 0 | q | 0 90 | ia,ab,bc,cd,de,ef,fg,gh,ha,ha | 0,90,180,180,270,270,0,0,90,0 | - | 0 | a | 45 90 | jb,bc,cd,de,ef,fg,gh,ha,ha | 45,180,180,270,270,0,0,90,0 | - | 0 | q | 90 90 | kc,cd,de,ef,fg,gh,ha,ha | 90,180,270,270,0,0,90,0 | - | 0 | a | 135 90 | ld,de,ef,fg,gh,ha,ha | 135,270,270,0,0,90,0 | - | 0 | a | 180 90 | me,ef,fg,gh,ha,ha | 180,270,0,0,90,0 | - | 0 | a | 225 90 | nf,fg,gh,ha,ha | 225,0,0,90,0 | - | 0 | a | 270 90 | og,gh,ha,ha | 270,0,90,0 | - | 0 | a | 315 90 | ph,ha,ha | 315,90,0 | + | 0 | q | 0 90 | ia,ab,bc,cd,de,ef,fg,gh,ha,ha | 0->0,0->90,90->180,180->180,180->270,270->270,270->0,0->0,0->90,90->0 | + | 0 | a | 45 90 | jb,bc,cd,de,ef,fg,gh,ha,ha | 0->45,45->180,180->180,180->270,270->270,270->0,0->0,0->90,90->0 | + | 0 | q | 90 90 | kc,cd,de,ef,fg,gh,ha,ha | 0->90,90->180,180->270,270->270,270->0,0->0,0->90,90->0 | + | 0 | a | 135 90 | ld,de,ef,fg,gh,ha,ha | 0->135,135->270,270->270,270->0,0->0,0->90,90->0 | + | 0 | a | 180 90 | me,ef,fg,gh,ha,ha | 0->180,180->270,270->0,0->0,0->90,90->0 | + | 0 | a | 225 90 | nf,fg,gh,ha,ha | 0->225,225->0,0->0,0->90,90->0 | + | 0 | a | 270 90 | og,gh,ha,ha | 0->270,270->0,0->90,90->0 | + | 0 | a | 315 90 | ph,ha,ha | 0->315,315->90,90->0 | diff --git a/features/testbot/projection.feature b/features/testbot/projection.feature index ad4a32b5d..cabd38e96 100644 --- a/features/testbot/projection.feature +++ b/features/testbot/projection.feature @@ -24,12 +24,12 @@ Feature: Projection to nearest point on road Scenario: Projection onto way at high latitudes, 1km distance When I route I should get | from | to | route | bearing | distance | - | b | a | abc,abc | 225,0 +-1 | 1000m +- 7 | - | b | c | abc,abc | 45,0 +-1 | 1000m +- 7 | - | a | d | abc,abc | 45,0 +-1 | 1000m +- 7 | - | d | a | abc,abc | 225,0 +-1 | 1000m +- 7 | - | c | d | abc,abc | 225,0 +-1 | 1000m +- 8 | - | d | c | abc,abc | 45 +-1 | 1000m +- 8 | + | b | a | abc,abc | 0->225,225->0 | 1000m +- 7 | + | b | c | abc,abc | 0->45,45->0 | 1000m +- 7 | + | a | d | abc,abc | 0->45,45->0 | 1000m +- 7 | + | d | a | abc,abc | 0->225,225->0 | 1000m +- 7 | + | c | d | abc,abc | 0->225,224->0 | 1000m +- 8 | + | d | c | abc,abc | 0->44,45->0 | 1000m +- 8 | Scenario: Projection onto way at high latitudes, no distance When I route I should get