osrm-backend/features/guidance/perception.feature

193 lines
5.9 KiB
Gherkin
Raw Normal View History

2016-08-11 08:21:34 -04:00
@routing @guidance @perceived-angles
Feature: Simple Turns
Background:
Given the profile "car"
Given a grid size of 5 meters
Scenario: Turning into splitting road
Given the node map
2016-09-30 03:33:08 -04:00
"""
a
b
^
/ \
2016-09-30 03:33:08 -04:00
c d
|\
| e
|
2016-09-30 03:33:08 -04:00
f
"""
2016-08-11 08:21:34 -04:00
And the ways
| nodes | name | highway | oneway |
| ab | road | primary | no |
| bc | road | primary | yes |
| fdb | road | primary | yes |
| de | turn | primary | no |
When I route I should get
| waypoints | turns | route |
| f,a | depart,arrive | road,road |
| e,a | depart,turn slight right,arrive | turn,road,road |
Scenario: Turning into splitting road
Given the node map
"""
a
g-b
/\
/ \
c d
|\
| e
|
f
"""
And the ways
| nodes | name | highway | oneway |
| ab | road | primary | no |
| bc | road | primary | yes |
| fdb | road | primary | yes |
| de | turn | primary | no |
| bg | left | primary | yes |
When I route I should get
| waypoints | turns | route |
| f,a | depart,arrive | road,road |
| e,a | depart,turn slight right,arrive | turn,road,road |
| e,g | depart,turn slight right,turn left,arrive | turn,road,left,left |
| f,g | depart,turn left,arrive | road,left,left |
| f,c | depart,continue uturn,arrive | road,road,road |
2016-08-11 08:21:34 -04:00
Scenario: Middle Island
Given the node map
2016-09-30 03:33:08 -04:00
"""
a
b
c h
d g
e
f
"""
2016-08-11 08:21:34 -04:00
And the ways
| nodes | name | oneway |
| ab | road | no |
| ef | road | no |
| bcde | road | yes |
| eghb | road | yes |
When I route I should get
| waypoints | turns | route |
| a,f | depart,arrive | road,road |
| c,f | depart,arrive | road,road |
| f,a | depart,arrive | road,road |
| g,a | depart,arrive | road,road |
Scenario: Middle Island Over Bridge
Given the node map
2016-09-30 03:33:08 -04:00
"""
a
|
.b.
2016-09-30 03:33:08 -04:00
c h
| |
| |
2016-09-30 03:33:08 -04:00
1 2
| |
2016-09-30 03:33:08 -04:00
d g
'e'
|
2016-09-30 03:33:08 -04:00
f
"""
2016-08-11 08:21:34 -04:00
And the ways
| nodes | name | oneway |
| ab | road | no |
| ef | road | no |
| bc | road | yes |
| cd | bridge | yes |
| de | road | yes |
| eg | road | yes |
| gh | bridge | yes |
| hb | road | yes |
When I route I should get
| waypoints | turns | route |
| a,f | depart,arrive | road,road |
| c,f | depart,new name straight,arrive | bridge,road,road |
| 1,f | depart,new name straight,arrive | bridge,road,road |
| f,a | depart,arrive | road,road |
| g,a | depart,new name straight,arrive | bridge,road,road |
| 2,a | depart,new name straight,arrive | bridge,road,road |
@negative
Scenario: Don't Collapse Places:
Given the node map
2016-09-30 03:33:08 -04:00
"""
h
g
a b e f
c
d
"""
2016-08-11 08:21:34 -04:00
And the ways
| nodes | name | oneway |
| ab | place | no |
| cd | bottom | no |
| ef | place | no |
| gh | top | no |
| bcegb | place | yes |
When I route I should get
2016-08-15 06:43:26 -04:00
| waypoints | turns | route |
| a,d | depart,turn right,arrive | place,bottom,bottom |
| a,f | depart,continue left,continue right,arrive | place,place,place,place |
| d,f | depart,turn right,continue right,arrive | bottom,place,place,place |
| d,h | depart,turn right,continue left,turn right,arrive | bottom,place,place,top,top |
@bug @not-sorted @3179
Scenario: Adjusting road angles to not be sorted
Given the node map
"""
g
|
|
|
_e - - - - - - - - - f
/
a - - - - -b <
i \ _
h c - - - - - - - - - d
"""
And the ways
| nodes | name | oneway |
| ab | road | no |
| febcd | road | yes |
| ge | in | yes |
| eh | right | yes |
| ei | left | yes |
When I route I should get
| waypoints | route |
| g,a | in,road,road |