fix getTurnDirection, widen straight range, adjust tests accordingly

This commit is contained in:
Moritz Kobitzsch 2016-11-11 11:32:57 +01:00
parent fa1a0a1325
commit 78583d2c8c
4 changed files with 21 additions and 19 deletions

View File

@ -724,11 +724,11 @@ Feature: Collapse
| restriction | bc | dc | c | no_right_turn |
When I route I should get
| waypoints | route | turns |
| a,g | road,cross,cross | depart,turn left,arrive |
| a,e | road,road,road | depart,continue slight right,arrive |
| waypoints | route | turns |
| a,g | road,cross,cross | depart,turn left,arrive |
| a,e | road,road,road | depart,continue straight,arrive |
# We should discuss whether the next item should be collapsed to depart,turn right,arrive.
| a,f | road,road,cross,cross | depart,continue slight right,turn right,arrive |
| a,f | road,road,cross,cross | depart,continue straight,turn right,arrive |
Scenario: On-Off on Highway
Given the node map
@ -755,12 +755,13 @@ Feature: Collapse
Scenario: Don't collapse going straight if actual turn
Given the node map
"""
c e
d f
e
c |
\ d - - - f
\|
b
|
|
a
"""
@ -771,10 +772,10 @@ Feature: Collapse
| df | right | residential |
When I route I should get
| waypoints | route | turns |
| a,c | main,main | depart,arrive |
| a,e | main,straight,straight | depart,turn straight,arrive |
| a,f | main,straight,right,right | depart,turn straight,turn right,arrive |
| waypoints | route | turns | locations |
| a,c | main,main | depart,arrive | a,c |
| a,e | main,straight,straight | depart,turn straight,arrive | a,b,e |
| a,f | main,straight,right,right | depart,turn straight,turn right,arrive | a,b,d,f |
Scenario: Entering a segregated road
Given the node map

View File

@ -773,7 +773,7 @@ Feature: Simple Turns
When I route I should get
| waypoints | route | turns |
| a,j | Siemens,Siemens,Siemens | depart,continue slight right,arrive |
| a,j | Siemens,Siemens,Siemens | depart,continue straight,arrive |
| a,g | Siemens,Erna,Erna | depart,new name slight left,arrive |
| g,j | Erna,Siemens,Siemens | depart,turn sharp left,arrive |
| g,a | Erna,Siemens,Siemens | depart,new name slight right,arrive |

View File

@ -1373,5 +1373,5 @@ Feature: Simple Turns
| kchm | Alexanderstr | primary | yes |
When I route I should get
| waypoints | turns | route |
| a,d | depart,new name straight,arrive | Stralauer Str,Holzmarktstr,Holzmarktstr |
| waypoints | turns | route |
| a,d | depart,arrive | Stralauer Str,Holzmarktstr |

View File

@ -3,6 +3,7 @@
/* A set of tools required for guidance in both pre and post-processing */
#include "extractor/guidance/constants.hpp"
#include "extractor/guidance/turn_instruction.hpp"
#include "extractor/suffix_table.hpp"
#include "engine/guidance/route_step.hpp"
@ -50,11 +51,11 @@ inline extractor::guidance::DirectionModifier::Enum getTurnDirection(const doubl
return extractor::guidance::DirectionModifier::SharpRight;
if (angle >= 60 && angle < 140)
return extractor::guidance::DirectionModifier::Right;
if (angle >= 140 && angle < 170)
if (angle >= 140 && angle < 160)
return extractor::guidance::DirectionModifier::SlightRight;
if (angle >= 165 && angle <= 195)
if (angle >= 160 && angle <= 200)
return extractor::guidance::DirectionModifier::Straight;
if (angle > 190 && angle <= 220)
if (angle > 200 && angle <= 220)
return extractor::guidance::DirectionModifier::SlightLeft;
if (angle > 220 && angle <= 300)
return extractor::guidance::DirectionModifier::Left;