2016-07-21 04:11:00 -04:00
|
|
|
@routing @guidance @collapsing
|
|
|
|
Feature: Collapse
|
|
|
|
|
|
|
|
Background:
|
|
|
|
Given the profile "car"
|
|
|
|
Given a grid size of 5 meters
|
|
|
|
|
|
|
|
@reverse
|
|
|
|
Scenario: Collapse U-Turn Triangle Intersection
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2016-12-21 12:14:40 -05:00
|
|
|
g---f---e---d
|
|
|
|
\ /
|
|
|
|
\ /
|
|
|
|
a-----b-----c
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2016-07-21 04:11:00 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | highway | name | oneway |
|
|
|
|
| abc | primary | road | yes |
|
|
|
|
| defg | primary | road | yes |
|
2016-08-17 03:49:19 -04:00
|
|
|
| fb | primary_link | | yes |
|
|
|
|
| be | primary_link | | yes |
|
2016-07-21 04:11:00 -04:00
|
|
|
|
|
|
|
When I route I should get
|
2016-12-21 12:14:40 -05:00
|
|
|
| waypoints | route | turns | locations |
|
|
|
|
| a,g | road,road,road | depart,continue uturn,arrive | a,b,g |
|
|
|
|
| d,c | road,road,road | depart,continue uturn,arrive | d,f,c |
|
2016-07-21 04:11:00 -04:00
|
|
|
|
|
|
|
@reverse @traffic-signals
|
|
|
|
Scenario: Collapse U-Turn Triangle Intersection
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2016-12-21 12:14:40 -05:00
|
|
|
g---f---j---e---d
|
|
|
|
\ /
|
2016-09-30 03:33:08 -04:00
|
|
|
h i
|
2016-12-21 12:14:40 -05:00
|
|
|
\ /
|
|
|
|
a-------b-------c
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2016-07-21 04:11:00 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | highway | name | oneway |
|
|
|
|
| abc | primary | road | yes |
|
|
|
|
| dejfg | primary | road | yes |
|
2017-02-15 09:12:24 -05:00
|
|
|
| fhb | primary_link | | yes |
|
|
|
|
| bie | primary_link | | yes |
|
2016-07-21 04:11:00 -04:00
|
|
|
|
|
|
|
And the nodes
|
|
|
|
| node | highway |
|
|
|
|
| j | traffic_signals |
|
|
|
|
| h | traffic_signals |
|
|
|
|
| i | traffic_signals |
|
|
|
|
|
|
|
|
When I route I should get
|
2016-12-21 12:14:40 -05:00
|
|
|
| waypoints | route | turns | locations |
|
|
|
|
| a,g | road,road,road | depart,continue uturn,arrive | a,b,g |
|
2017-02-15 09:12:24 -05:00
|
|
|
| d,c | road,road,road | depart,continue uturn,arrive | d,f,c |
|
2016-10-26 17:32:29 -04:00
|
|
|
|
|
|
|
Scenario: Forking before a turn (forky)
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
g
|
|
|
|
.
|
|
|
|
c
|
|
|
|
a . . b .'
|
|
|
|
`d.
|
|
|
|
f e
|
|
|
|
"""
|
2017-02-15 09:12:24 -05:00
|
|
|
# note: check collapse.feature for a similar test case where we do not
|
2016-10-26 17:32:29 -04:00
|
|
|
# classify the situation as Sliproad and therefore keep the fork inst.
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | name | oneway | highway |
|
|
|
|
| ab | road | yes | primary |
|
|
|
|
| bd | road | yes | primary |
|
|
|
|
| bc | road | yes | primary |
|
|
|
|
| de | road | yes | primary |
|
|
|
|
| fd | cross | no | secondary |
|
|
|
|
| dc | cross | no | secondary |
|
|
|
|
| cg | cross | no | secondary |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction |
|
|
|
|
| restriction | bd | dc | d | no_left_turn |
|
|
|
|
| restriction | bc | dc | c | no_right_turn |
|
|
|
|
|
|
|
|
When I route I should get
|
2016-12-21 12:14:40 -05:00
|
|
|
| waypoints | route | turns | locations |
|
|
|
|
| a,g | road,cross,cross | depart,turn left,arrive | a,b,g |
|
2017-02-15 09:12:24 -05:00
|
|
|
| a,e | road,road,road | depart,continue slight right,arrive | a,b,e |
|
|
|
|
# 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,b,d,f |
|
|
|
|
|
|
|
|
Scenario: Forking before a turn (forky), larger
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
g
|
|
|
|
.
|
|
|
|
c
|
|
|
|
.'|
|
|
|
|
.' |
|
|
|
|
a . . b .' |
|
|
|
|
' . |
|
|
|
|
` d
|
|
|
|
f ' e
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | name | oneway | highway |
|
|
|
|
| ab | road | yes | primary |
|
|
|
|
| bd | road | yes | primary |
|
|
|
|
| bc | road | yes | primary |
|
|
|
|
| de | road | yes | primary |
|
|
|
|
| fd | cross | no | secondary |
|
|
|
|
| dc | cross | no | secondary |
|
|
|
|
| cg | cross | no | secondary |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction |
|
|
|
|
| restriction | bd | dc | d | no_left_turn |
|
|
|
|
| restriction | bc | dc | c | no_right_turn |
|
|
|
|
|
|
|
|
When I route I should get
|
|
|
|
| waypoints | route | turns | locations |
|
|
|
|
| a,g | road,cross,cross | depart,turn left,arrive | a,b,g |
|
|
|
|
| a,e | road,road,road | depart,continue slight right,arrive | a,b,e |
|
2016-10-26 17:32:29 -04:00
|
|
|
# We should discuss whether the next item should be collapsed to depart,turn right,arrive.
|
2016-12-21 12:14:40 -05:00
|
|
|
| a,f | road,road,cross,cross | depart,continue slight right,turn right,arrive | a,b,d,f |
|
2017-02-15 09:12:24 -05:00
|
|
|
|
|
|
|
Scenario: Pulled Back Turn
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
d
|
|
|
|
|
|
|
|
|
a-b-c
|
|
|
|
|
|
|
|
|
e
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | highway | name |
|
|
|
|
| abc | tertiary | road |
|
|
|
|
| cd | tertiary | left |
|
|
|
|
| be | tertiary | right |
|
|
|
|
|
|
|
|
When I route I should get
|
|
|
|
| waypoints | route | turns |
|
|
|
|
| a,d | road,left,left | depart,turn left,arrive |
|
|
|
|
| a,e | road,right,right | depart,turn right,arrive |
|