2012-09-30 08:40:59 -04:00
|
|
|
@routing @car @restrictions
|
2012-10-01 07:27:08 -04:00
|
|
|
Feature: Car - Turn restrictions
|
2014-03-27 16:46:53 -04:00
|
|
|
# Handle turn restrictions as defined by http://wiki.openstreetmap.org/wiki/Relation:restriction
|
|
|
|
# Note that if u-turns are allowed, turn restrictions can lead to suprising, but correct, routes.
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
Background: Use car routing
|
|
|
|
Given the profile "car"
|
2016-05-30 11:42:28 -04:00
|
|
|
Given a grid size of 200 meters
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
@no_turning
|
|
|
|
Scenario: Car - No left turn
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2017-10-11 05:07:43 -04:00
|
|
|
a
|
|
|
|
d j b
|
|
|
|
c
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
2017-10-11 05:07:43 -04:00
|
|
|
| cj | yes |
|
|
|
|
| aj | -1 |
|
|
|
|
| dj | -1 |
|
|
|
|
| bj | -1 |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction |
|
2017-10-11 05:07:43 -04:00
|
|
|
| restriction | cj | dj | j | no_left_turn |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 19:39:31 -04:00
|
|
|
| from | to | route |
|
2017-10-11 05:07:43 -04:00
|
|
|
| c | d | |
|
|
|
|
| c | a | cj,aj,aj |
|
|
|
|
| c | b | cj,bj,bj |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
2014-05-19 06:53:27 -04:00
|
|
|
@no_turning
|
|
|
|
Scenario: Car - No straight on
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
a b j d e
|
|
|
|
v z
|
|
|
|
w x y
|
|
|
|
"""
|
2014-05-19 06:53:27 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| ab | no |
|
|
|
|
| bj | no |
|
|
|
|
| jd | no |
|
|
|
|
| de | no |
|
|
|
|
| av | yes |
|
|
|
|
| vw | yes |
|
|
|
|
| wx | yes |
|
|
|
|
| xy | yes |
|
|
|
|
| yz | yes |
|
|
|
|
| ze | yes |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction |
|
|
|
|
| restriction | bj | jd | j | no_straight_on |
|
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 19:39:31 -04:00
|
|
|
| from | to | route |
|
|
|
|
| a | e | av,vw,wx,xy,yz,ze,ze |
|
2014-05-19 06:53:27 -04:00
|
|
|
|
2013-08-29 13:29:13 -04:00
|
|
|
@no_turning
|
|
|
|
Scenario: Car - No right turn
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2017-10-11 05:07:43 -04:00
|
|
|
a
|
|
|
|
d j b
|
|
|
|
c
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
2017-10-11 05:07:43 -04:00
|
|
|
| cj | yes |
|
|
|
|
| aj | -1 |
|
|
|
|
| dj | -1 |
|
|
|
|
| bj | -1 |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction |
|
2017-10-11 05:07:43 -04:00
|
|
|
| restriction | cj | bj | j | no_right_turn |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 19:39:31 -04:00
|
|
|
| from | to | route |
|
2017-10-11 05:07:43 -04:00
|
|
|
| c | d | cj,dj,dj |
|
|
|
|
| c | a | cj,aj,aj |
|
|
|
|
| c | b | |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
@no_turning
|
|
|
|
Scenario: Car - No u-turn
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2017-10-11 05:07:43 -04:00
|
|
|
a
|
|
|
|
d j b
|
|
|
|
c
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
2017-10-11 05:07:43 -04:00
|
|
|
| cj | yes |
|
|
|
|
| aj | -1 |
|
|
|
|
| dj | -1 |
|
|
|
|
| bj | -1 |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction |
|
2017-10-11 05:07:43 -04:00
|
|
|
| restriction | cj | dj | j | no_u_turn |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 19:39:31 -04:00
|
|
|
| from | to | route |
|
2017-10-11 05:07:43 -04:00
|
|
|
| c | d | |
|
|
|
|
| c | a | cj,aj,aj |
|
|
|
|
| c | b | cj,bj,bj |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
2022-10-10 16:27:27 -04:00
|
|
|
@no_turning
|
|
|
|
Scenario: Car - No u-turn
|
|
|
|
# https://www.openstreetmap.org/edit?node=54878482#map=19/34.05242/-117.19067
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
c
|
|
|
|
3
|
|
|
|
a 1 x 2 b
|
|
|
|
4
|
|
|
|
d
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| ax |
|
|
|
|
| xb |
|
|
|
|
| cx |
|
|
|
|
| xd |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction |
|
|
|
|
| restriction | ax | ax | x | no_u_turn |
|
|
|
|
| restriction | bx | bx | x | no_u_turn |
|
|
|
|
| restriction | cx | cx | x | no_u_turn |
|
|
|
|
| restriction | dx | dx | x | no_u_turn |
|
|
|
|
|
|
|
|
When I route I should get
|
|
|
|
| waypoints | route | turns |
|
|
|
|
| a,x,a | ax,xb,xb,xb,ax,ax | depart,new name straight,continue uturn,arrive,depart,arrive |
|
|
|
|
|
2013-08-29 13:29:13 -04:00
|
|
|
@no_turning
|
|
|
|
Scenario: Car - Handle any no_* relation
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2017-10-11 05:07:43 -04:00
|
|
|
a
|
|
|
|
d j b
|
|
|
|
c
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
2017-10-11 05:07:43 -04:00
|
|
|
| cj | yes |
|
|
|
|
| aj | -1 |
|
|
|
|
| dj | -1 |
|
|
|
|
| bj | -1 |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction |
|
2017-10-11 05:07:43 -04:00
|
|
|
| restriction | cj | dj | j | no_weird_zigzags |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 19:39:31 -04:00
|
|
|
| from | to | route |
|
2017-10-11 05:07:43 -04:00
|
|
|
| c | d | |
|
|
|
|
| c | a | cj,aj,aj |
|
|
|
|
| c | b | cj,bj,bj |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
2018-01-18 16:28:17 -05:00
|
|
|
@no_turning
|
|
|
|
Scenario: Car - Ignore no_*_on_red relations
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a
|
|
|
|
d j b
|
|
|
|
c
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| cj | yes |
|
|
|
|
| aj | -1 |
|
|
|
|
| dj | -1 |
|
|
|
|
| bj | -1 |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction |
|
|
|
|
| restriction | cj | dj | j | no_turn_on_red |
|
|
|
|
| restriction | cj | bj | j | no_right_turn_on_red |
|
|
|
|
|
|
|
|
When I route I should get
|
|
|
|
| from | to | route |
|
|
|
|
| c | d | cj,dj,dj |
|
|
|
|
| c | a | cj,aj,aj |
|
|
|
|
| c | b | cj,bj,bj |
|
|
|
|
|
2013-08-29 13:29:13 -04:00
|
|
|
@only_turning
|
|
|
|
Scenario: Car - Only left turn
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2017-10-11 05:07:43 -04:00
|
|
|
a
|
|
|
|
d j b
|
|
|
|
c
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
2017-10-11 05:07:43 -04:00
|
|
|
| cj | yes |
|
|
|
|
| aj | -1 |
|
|
|
|
| dj | -1 |
|
|
|
|
| bj | -1 |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction |
|
2017-10-11 05:07:43 -04:00
|
|
|
| restriction | cj | dj | j | only_left_turn |
|
|
|
|
|
|
|
|
When I route I should get
|
|
|
|
| from | to | route |
|
|
|
|
| c | a | |
|
|
|
|
| c | b | |
|
|
|
|
| c | d | cj,dj,dj |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
2016-08-31 09:22:36 -04:00
|
|
|
Scenario: Car - Only right turn, invalid
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2017-10-11 05:07:43 -04:00
|
|
|
a
|
|
|
|
d j b r
|
|
|
|
c
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2016-08-31 09:22:36 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
2017-10-11 05:07:43 -04:00
|
|
|
| cj | yes |
|
|
|
|
| aj | -1 |
|
|
|
|
| dj | -1 |
|
|
|
|
| bj | -1 |
|
|
|
|
| rb | -1 |
|
2016-08-31 09:22:36 -04:00
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction |
|
2017-10-11 05:07:43 -04:00
|
|
|
| restriction | cj | br | j | only_right_on |
|
2016-08-31 09:22:36 -04:00
|
|
|
|
2013-08-29 13:29:13 -04:00
|
|
|
When I route I should get
|
2016-08-31 09:22:36 -04:00
|
|
|
| from | to | route |
|
2017-10-11 05:07:43 -04:00
|
|
|
| c | r | cj,bj,rb,rb |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
@only_turning
|
|
|
|
Scenario: Car - Only right turn
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2017-10-11 05:07:43 -04:00
|
|
|
a
|
|
|
|
d j b
|
|
|
|
c
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
2017-10-11 05:07:43 -04:00
|
|
|
| cj | yes |
|
|
|
|
| aj | -1 |
|
|
|
|
| dj | -1 |
|
|
|
|
| bj | -1 |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction |
|
2017-10-11 05:07:43 -04:00
|
|
|
| restriction | cj | bj | j | only_right_turn |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 19:39:31 -04:00
|
|
|
| from | to | route |
|
2017-10-11 05:07:43 -04:00
|
|
|
| c | d | |
|
|
|
|
| c | a | |
|
|
|
|
| c | b | cj,bj,bj |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
@only_turning
|
|
|
|
Scenario: Car - Only straight on
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2017-10-11 05:07:43 -04:00
|
|
|
a
|
|
|
|
d j b
|
|
|
|
c
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
2017-10-11 05:07:43 -04:00
|
|
|
| cj | yes |
|
|
|
|
| aj | -1 |
|
|
|
|
| dj | -1 |
|
|
|
|
| bj | -1 |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction |
|
2017-10-11 05:07:43 -04:00
|
|
|
| restriction | cj | aj | j | only_straight_on |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 19:39:31 -04:00
|
|
|
| from | to | route |
|
2017-10-11 05:07:43 -04:00
|
|
|
| c | d | |
|
|
|
|
| c | a | cj,aj,aj |
|
|
|
|
| c | b | |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
@no_turning
|
|
|
|
Scenario: Car - Handle any only_* restriction
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2017-10-11 05:07:43 -04:00
|
|
|
a
|
|
|
|
d j b
|
|
|
|
c
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
2017-10-11 05:07:43 -04:00
|
|
|
| cj | yes |
|
|
|
|
| aj | -1 |
|
|
|
|
| dj | -1 |
|
|
|
|
| bj | -1 |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction |
|
2017-10-11 05:07:43 -04:00
|
|
|
| restriction | cj | aj | j | only_weird_zigzags |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 19:39:31 -04:00
|
|
|
| from | to | route |
|
2017-10-11 05:07:43 -04:00
|
|
|
| c | d | |
|
|
|
|
| c | a | cj,aj,aj |
|
|
|
|
| c | b | |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
2015-09-10 00:53:41 -04:00
|
|
|
@specific
|
|
|
|
Scenario: Car - :hgv-qualified on a standard turn restriction
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2017-10-11 05:07:43 -04:00
|
|
|
a
|
|
|
|
d j b
|
|
|
|
c
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2015-09-10 00:53:41 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
2017-10-11 05:07:43 -04:00
|
|
|
| cj | yes |
|
|
|
|
| aj | -1 |
|
|
|
|
| dj | -1 |
|
|
|
|
| bj | -1 |
|
2015-09-10 00:53:41 -04:00
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction:hgv |
|
2017-10-11 05:07:43 -04:00
|
|
|
| restriction | cj | aj | j | no_straight_on |
|
2015-09-10 00:53:41 -04:00
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 19:39:31 -04:00
|
|
|
| from | to | route |
|
2017-10-11 05:07:43 -04:00
|
|
|
| c | d | cj,dj,dj |
|
|
|
|
| c | a | cj,aj,aj |
|
|
|
|
| c | b | cj,bj,bj |
|
2015-09-10 00:53:41 -04:00
|
|
|
|
|
|
|
@specific
|
|
|
|
Scenario: Car - :motorcar-qualified on a standard turn restriction
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2017-10-11 05:07:43 -04:00
|
|
|
a
|
|
|
|
d j b
|
|
|
|
c
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2015-09-10 00:53:41 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
2017-10-11 05:07:43 -04:00
|
|
|
| cj | yes |
|
|
|
|
| aj | -1 |
|
|
|
|
| dj | -1 |
|
|
|
|
| bj | -1 |
|
2015-09-10 00:53:41 -04:00
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction:motorcar |
|
2017-10-11 05:07:43 -04:00
|
|
|
| restriction | cj | aj | j | no_straight_on |
|
2015-09-10 00:53:41 -04:00
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 19:39:31 -04:00
|
|
|
| from | to | route |
|
2017-10-11 05:07:43 -04:00
|
|
|
| c | d | cj,dj,dj |
|
|
|
|
| c | a | |
|
|
|
|
| c | b | cj,bj,bj |
|
2015-09-10 00:53:41 -04:00
|
|
|
|
2013-08-29 13:29:13 -04:00
|
|
|
@except
|
|
|
|
Scenario: Car - Except tag and on no_ restrictions
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
b x c
|
|
|
|
a j d
|
|
|
|
s
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| sj | no |
|
|
|
|
| xj | -1 |
|
|
|
|
| aj | -1 |
|
|
|
|
| bj | no |
|
|
|
|
| cj | no |
|
|
|
|
| dj | -1 |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction | except |
|
|
|
|
| restriction | sj | aj | j | no_left_turn | motorcar |
|
|
|
|
| restriction | sj | bj | j | no_left_turn | |
|
|
|
|
| restriction | sj | cj | j | no_right_turn | |
|
|
|
|
| restriction | sj | dj | j | no_right_turn | motorcar |
|
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 19:39:31 -04:00
|
|
|
| from | to | route |
|
|
|
|
| s | a | sj,aj,aj |
|
|
|
|
| s | b | |
|
|
|
|
| s | c | |
|
|
|
|
| s | d | sj,dj,dj |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
@except
|
|
|
|
Scenario: Car - Except tag and on only_ restrictions
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
a b
|
|
|
|
j
|
|
|
|
s
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| sj | yes |
|
|
|
|
| aj | no |
|
|
|
|
| bj | no |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction | except |
|
|
|
|
| restriction | sj | aj | j | only_straight_on | motorcar |
|
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 19:39:31 -04:00
|
|
|
| from | to | route |
|
|
|
|
| s | a | sj,aj,aj |
|
|
|
|
| s | b | sj,bj,bj |
|
2014-06-10 11:23:24 -04:00
|
|
|
|
|
|
|
@except
|
|
|
|
Scenario: Car - Several only_ restrictions at the same segment
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
y
|
|
|
|
i j f b x a e g h
|
|
|
|
|
2022-08-27 06:36:20 -04:00
|
|
|
c1 d
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2014-06-10 11:23:24 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| fb | no |
|
|
|
|
| bx | -1 |
|
|
|
|
| xa | no |
|
|
|
|
| ae | no |
|
|
|
|
| cb | no |
|
|
|
|
| dc | -1 |
|
|
|
|
| da | no |
|
|
|
|
| fj | no |
|
|
|
|
| jf | no |
|
|
|
|
| ge | no |
|
|
|
|
| hg | no |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction |
|
|
|
|
| restriction | ae | xa | a | only_straight_on |
|
|
|
|
| restriction | xb | fb | b | only_straight_on |
|
|
|
|
| restriction | cb | bx | b | only_right_turn |
|
|
|
|
| restriction | da | ae | a | only_right_turn |
|
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 19:39:31 -04:00
|
|
|
| from | to | route |
|
|
|
|
| e | f | ae,xa,bx,fb,fb |
|
2022-08-27 06:36:20 -04:00
|
|
|
| 1 | f | dc,da,ae,ge,hg,hg,ge,ae,xa,bx,fb,fb |
|
2016-03-31 19:39:31 -04:00
|
|
|
| d | f | da,ae,ge,hg,hg,ge,ae,xa,bx,fb,fb |
|
2014-07-15 09:10:13 -04:00
|
|
|
|
|
|
|
@except
|
|
|
|
Scenario: Car - two only_ restrictions share same to-way
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
e f
|
|
|
|
a
|
|
|
|
|
|
|
|
c x d
|
|
|
|
y
|
|
|
|
|
|
|
|
b
|
|
|
|
"""
|
2014-07-15 09:10:13 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| ef | no |
|
|
|
|
| ce | no |
|
|
|
|
| fd | no |
|
|
|
|
| ca | no |
|
|
|
|
| ad | no |
|
|
|
|
| ax | no |
|
|
|
|
| xy | no |
|
|
|
|
| yb | no |
|
|
|
|
| cb | no |
|
|
|
|
| db | no |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction |
|
|
|
|
| restriction | ax | xy | x | only_straight_on |
|
|
|
|
| restriction | by | xy | y | only_straight_on |
|
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 19:39:31 -04:00
|
|
|
| from | to | route |
|
|
|
|
| a | b | ax,xy,yb,yb |
|
|
|
|
| b | a | yb,xy,ax,ax |
|
2014-07-15 09:10:13 -04:00
|
|
|
|
|
|
|
@except
|
|
|
|
Scenario: Car - two only_ restrictions share same from-way
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
e f
|
|
|
|
a
|
|
|
|
|
|
|
|
c x d
|
|
|
|
y
|
|
|
|
|
|
|
|
b
|
|
|
|
"""
|
2014-07-15 09:10:13 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| ef | no |
|
|
|
|
| ce | no |
|
|
|
|
| fd | no |
|
|
|
|
| ca | no |
|
|
|
|
| ad | no |
|
|
|
|
| ax | no |
|
|
|
|
| xy | no |
|
|
|
|
| yb | no |
|
|
|
|
| cb | no |
|
|
|
|
| db | no |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction |
|
|
|
|
| restriction | xy | xa | x | only_straight_on |
|
|
|
|
| restriction | xy | yb | y | only_straight_on |
|
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 19:39:31 -04:00
|
|
|
| from | to | route |
|
|
|
|
| a | b | ax,xy,yb,yb |
|
|
|
|
| b | a | yb,xy,ax,ax |
|
2014-07-15 09:10:13 -04:00
|
|
|
|
2016-08-31 09:52:05 -04:00
|
|
|
@specific
|
|
|
|
Scenario: Car - Ignore unrecognized restriction
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2017-10-11 05:07:43 -04:00
|
|
|
a
|
|
|
|
d j b
|
|
|
|
c
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
2016-08-31 09:52:05 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
2017-10-11 05:07:43 -04:00
|
|
|
| cj | yes |
|
|
|
|
| aj | -1 |
|
|
|
|
| dj | -1 |
|
|
|
|
| bj | -1 |
|
2016-08-31 09:52:05 -04:00
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction |
|
2017-10-11 05:07:43 -04:00
|
|
|
| restriction | cj | dj | j | yield |
|
2016-08-31 09:52:05 -04:00
|
|
|
|
|
|
|
When I route I should get
|
|
|
|
| from | to | route |
|
2017-10-11 05:07:43 -04:00
|
|
|
| c | d | cj,dj,dj |
|
|
|
|
| c | a | cj,aj,aj |
|
|
|
|
| c | b | cj,bj,bj |
|
2016-08-31 09:52:05 -04:00
|
|
|
|
2017-07-05 09:38:05 -04:00
|
|
|
@restriction @compression
|
|
|
|
Scenario: Restriction On Compressed Geometry
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
i
|
|
|
|
|
|
|
|
|
f - e
|
|
|
|
| |
|
|
|
|
a - b - c - d
|
|
|
|
|
|
|
|
|
g
|
|
|
|
|
|
|
|
|
h
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| abc |
|
|
|
|
| cde |
|
|
|
|
| efc |
|
|
|
|
| cgh |
|
|
|
|
| ei |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | node:via | way:to | restriction |
|
|
|
|
| restriction | abc | c | cgh | no_right_turn |
|
|
|
|
|
|
|
|
When I route I should get
|
|
|
|
| from | to | route |
|
|
|
|
| a | h | abc,cde,efc,cgh,cgh |
|
|
|
|
|
2017-07-11 08:22:28 -04:00
|
|
|
@restriction-way
|
2017-07-05 09:38:05 -04:00
|
|
|
Scenario: Car - prohibit turn
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
c
|
|
|
|
|
|
|
|
|
| f
|
|
|
|
| |
|
|
|
|
b---e
|
|
|
|
| |
|
|
|
|
a d
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| ab |
|
|
|
|
| bc |
|
|
|
|
| be |
|
|
|
|
| de |
|
|
|
|
| ef |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:via | way:to | restriction |
|
|
|
|
| restriction | ab | be | de | no_right_turn |
|
|
|
|
|
|
|
|
When I route I should get
|
2017-07-11 08:22:28 -04:00
|
|
|
| from | to | route | turns | locations |
|
|
|
|
| a | d | ab,be,ef,ef,de,de | depart,turn right,turn left,continue uturn,new name straight,arrive | a,b,e,f,e,d |
|
|
|
|
| a | f | ab,be,ef,ef | depart,turn right,turn left,arrive | a,b,e,f |
|
|
|
|
| c | d | bc,be,de,de | depart,turn left,turn right,arrive | c,b,e,d |
|
|
|
|
| c | f | bc,be,ef,ef | depart,turn left,turn left,arrive | c,b,e,f |
|
2017-07-05 09:38:05 -04:00
|
|
|
|
2017-11-21 14:23:35 -05:00
|
|
|
@restriction-way @overlap
|
2017-07-05 09:38:05 -04:00
|
|
|
Scenario: Car - prohibit turn
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
c
|
|
|
|
|
|
|
|
|
| f
|
|
|
|
| |
|
|
|
|
b---e
|
|
|
|
| |
|
|
|
|
| d
|
|
|
|
|
|
|
|
|
a
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| ab |
|
|
|
|
| bc |
|
|
|
|
| be |
|
|
|
|
| de |
|
|
|
|
| ef |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:via | way:to | restriction |
|
|
|
|
| restriction | ab | be | de | no_right_turn |
|
|
|
|
| restriction | bc | be | ef | no_left_turn |
|
|
|
|
|
|
|
|
When I route I should get
|
2017-07-11 08:22:28 -04:00
|
|
|
| from | to | route |
|
|
|
|
| a | d | ab,be,ef,ef,de,de |
|
|
|
|
| a | f | ab,be,ef,ef |
|
|
|
|
| c | d | bc,be,de,de |
|
|
|
|
| c | f | bc,be,de,de,ef,ef |
|
2017-07-05 09:38:05 -04:00
|
|
|
|
|
|
|
@restriction-way @overlap
|
|
|
|
Scenario: Two times same way
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
h g
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |
|
2017-07-11 08:22:28 -04:00
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
a - b - c - - - - - - - - - - - - - - - - - - - f
|
|
|
|
| | \ /
|
|
|
|
i - d - e - - - - - - - - - - - - - - - - -
|
2017-07-05 09:38:05 -04:00
|
|
|
"""
|
2017-07-27 05:42:13 -04:00
|
|
|
# The long distances here are required to make other turns undesriable in comparison to the restricted turns.
|
|
|
|
# Otherwise they might just be picked without the actual turns being restricted
|
2017-07-05 09:38:05 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| ab | no |
|
|
|
|
| bc | no |
|
|
|
|
| cd | yes |
|
|
|
|
| ce | yes |
|
|
|
|
| cf | yes |
|
|
|
|
| cg | yes |
|
|
|
|
| bh | no |
|
|
|
|
| fedib | yes |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:via | way:to | restriction |
|
|
|
|
| restriction | ab | bc | ce | no_right_turn |
|
|
|
|
| restriction | ab | bc | cd | no_right_turn |
|
|
|
|
|
|
|
|
When I route I should get
|
|
|
|
| from | to | route |
|
2017-07-11 08:22:28 -04:00
|
|
|
| a | i | ab,bc,cf,fedib,fedib |
|
2017-07-05 09:38:05 -04:00
|
|
|
|
|
|
|
|
|
|
|
@restriction-way @overlap
|
|
|
|
Scenario: Car - prohibit turn
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a j
|
|
|
|
| |
|
|
|
|
b---i
|
|
|
|
| |
|
|
|
|
c---h
|
|
|
|
| |
|
|
|
|
d---g
|
|
|
|
| |
|
|
|
|
e f
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | name | oneway |
|
|
|
|
| ab | left | yes |
|
|
|
|
| bc | left | yes |
|
|
|
|
| cd | left | yes |
|
|
|
|
| de | left | yes |
|
|
|
|
| fg | right | yes |
|
|
|
|
| gh | right | yes |
|
|
|
|
| hi | right | yes |
|
|
|
|
| ij | right | yes |
|
|
|
|
| dg | first | no |
|
|
|
|
| ch | second | no |
|
|
|
|
| bi | third | no |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:via | way:to | restriction |
|
|
|
|
| restriction | ab | bi | ij | no_u_turn |
|
|
|
|
| restriction | bc | ch | hi | no_u_turn |
|
|
|
|
| restriction | fg | dg | de | no_u_turn |
|
|
|
|
| restriction | gh | ch | cd | no_u_turn |
|
|
|
|
|
|
|
|
When I route I should get
|
|
|
|
| from | to | route |
|
2017-07-11 08:22:28 -04:00
|
|
|
| a | j | left,first,right,right |
|
|
|
|
| f | e | right,third,left,left |
|
2017-07-05 09:38:05 -04:00
|
|
|
|
2017-11-21 14:23:35 -05:00
|
|
|
@restriction-way
|
2017-07-05 09:38:05 -04:00
|
|
|
Scenario: Car - allow only turn
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
c
|
|
|
|
|
|
|
|
|
| f
|
|
|
|
| |
|
|
|
|
b---e
|
|
|
|
| |
|
|
|
|
a d
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| ab |
|
|
|
|
| bc |
|
|
|
|
| be |
|
|
|
|
| de |
|
|
|
|
| ef |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:via | way:to | restriction |
|
|
|
|
| restriction | ab | be | ef | only_left_on |
|
|
|
|
|
|
|
|
When I route I should get
|
2017-07-11 08:22:28 -04:00
|
|
|
| from | to | route | turns | locations |
|
|
|
|
| a | d | ab,be,ef,ef,de,de | depart,turn right,turn left,continue uturn,new name straight,arrive | a,b,e,f,e,d |
|
|
|
|
| a | f | ab,be,ef,ef | depart,turn right,turn left,arrive | a,b,e,f |
|
|
|
|
| c | d | bc,be,de,de | depart,turn left,turn right,arrive | c,b,e,d |
|
|
|
|
| c | f | bc,be,ef,ef | depart,turn left,turn left,arrive | c,b,e,f |
|
2017-07-05 09:38:05 -04:00
|
|
|
|
2017-11-21 14:23:35 -05:00
|
|
|
@restriction-way
|
2017-07-05 09:38:05 -04:00
|
|
|
Scenario: Car - allow only turn
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
c
|
|
|
|
|
|
|
|
|
| f
|
|
|
|
| |
|
|
|
|
b---e
|
|
|
|
| |
|
|
|
|
a d
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| ab |
|
|
|
|
| bc |
|
|
|
|
| be |
|
|
|
|
| de |
|
|
|
|
| ef |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:via | way:to | restriction |
|
|
|
|
| restriction | ab | be | ed | only_right_on |
|
|
|
|
|
|
|
|
When I route I should get
|
|
|
|
| from | to | route |
|
|
|
|
| a | d | ab,be,de,de |
|
|
|
|
|
2017-11-21 14:23:35 -05:00
|
|
|
@restriction-way
|
2017-07-05 09:38:05 -04:00
|
|
|
Scenario: Car - prohibit turn, traffic lights
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
c
|
|
|
|
|
|
|
|
|
| f
|
|
|
|
| |
|
|
|
|
b---e
|
|
|
|
| |
|
|
|
|
a d
|
|
|
|
| |
|
|
|
|
g i
|
|
|
|
| |
|
|
|
|
h j
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | name |
|
|
|
|
| hgab | ab |
|
|
|
|
| bc | bc |
|
|
|
|
| be | be |
|
|
|
|
| jide | de |
|
|
|
|
| ef | ef |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:via | way:to | restriction |
|
|
|
|
| restriction | hgab | be | jide | no_right_turn |
|
|
|
|
|
|
|
|
And the nodes
|
|
|
|
| node | highway |
|
|
|
|
| g | traffic_signals |
|
|
|
|
| i | traffic_signals |
|
|
|
|
|
|
|
|
|
|
|
|
When I route I should get
|
2017-07-11 08:22:28 -04:00
|
|
|
| from | to | route | turns | locations |
|
|
|
|
| a | d | ab,be,ef,ef,de,de | depart,turn right,turn left,continue uturn,new name straight,arrive | a,b,e,f,e,d |
|
|
|
|
| a | f | ab,be,ef,ef | depart,turn right,turn left,arrive | a,b,e,f |
|
|
|
|
| c | d | bc,be,de,de | depart,turn left,turn right,arrive | c,b,e,d |
|
|
|
|
| c | f | bc,be,ef,ef | depart,turn left,turn left,arrive | c,b,e,f |
|
2017-07-19 06:57:51 -04:00
|
|
|
|
|
|
|
|
2017-11-21 14:23:35 -05:00
|
|
|
@restriction-way @overlap @geometry
|
2017-07-19 06:57:51 -04:00
|
|
|
Scenario: Geometry
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
c
|
|
|
|
|
|
|
|
|
| f
|
|
|
|
| |
|
|
|
|
b-g-e
|
|
|
|
| |
|
|
|
|
| d
|
|
|
|
|
|
|
|
|
a
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| ab |
|
|
|
|
| bc |
|
|
|
|
| bge |
|
|
|
|
| de |
|
|
|
|
| ef |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:via | way:to | restriction |
|
|
|
|
| restriction | ab | bge | de | no_right_turn |
|
|
|
|
| restriction | bc | bge | ef | no_left_turn |
|
|
|
|
|
|
|
|
When I route I should get
|
|
|
|
| from | to | route |
|
|
|
|
| a | d | ab,bge,ef,ef,de,de |
|
|
|
|
| a | f | ab,bge,ef,ef |
|
|
|
|
| c | d | bc,bge,de,de |
|
|
|
|
| c | f | bc,bge,de,de,ef,ef |
|
|
|
|
|
2017-11-21 14:23:35 -05:00
|
|
|
@restriction-way @overlap @geometry @traffic-signals
|
2017-07-19 06:57:51 -04:00
|
|
|
Scenario: Geometry
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
c
|
|
|
|
|
|
|
|
|
| f
|
|
|
|
| |
|
|
|
|
b-g-e
|
|
|
|
| |
|
|
|
|
| d
|
|
|
|
|
|
|
|
|
a
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| ab |
|
|
|
|
| bc |
|
|
|
|
| bge |
|
|
|
|
| de |
|
|
|
|
| ef |
|
|
|
|
|
|
|
|
And the nodes
|
|
|
|
| node | highway |
|
|
|
|
| g | traffic_signals |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:via | way:to | restriction |
|
|
|
|
| restriction | ab | bge | de | no_right_turn |
|
|
|
|
| restriction | bc | bge | ef | no_left_turn |
|
|
|
|
|
|
|
|
When I route I should get
|
2017-07-20 08:03:39 -04:00
|
|
|
| from | to | route |
|
|
|
|
| a | d | ab,bge,ef,ef,de,de |
|
|
|
|
| a | f | ab,bge,ef,ef |
|
|
|
|
| c | d | bc,bge,de,de |
|
|
|
|
| c | f | bc,bge,de,de,ef,ef |
|
2017-07-19 06:57:51 -04:00
|
|
|
|
|
|
|
# don't crash hard on invalid restrictions
|
2017-11-21 14:23:35 -05:00
|
|
|
@restriction-way @invalid
|
2017-07-19 06:57:51 -04:00
|
|
|
Scenario: Geometry
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
c
|
|
|
|
|
|
|
|
|
| f
|
|
|
|
| |
|
|
|
|
b---e
|
|
|
|
| |
|
|
|
|
| d
|
|
|
|
|
|
|
|
|
a
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| ab | |
|
|
|
|
| bc | |
|
|
|
|
| be | yes |
|
|
|
|
| de | |
|
|
|
|
| ef | |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:via | way:to | restriction |
|
|
|
|
| restriction | de | be | ab | no_left_turn |
|
|
|
|
|
|
|
|
When I route I should get
|
|
|
|
| from | to | route |
|
|
|
|
| a | f | ab,be,ef,ef |
|
2017-08-01 08:58:31 -04:00
|
|
|
|
|
|
|
|
2017-11-21 14:23:35 -05:00
|
|
|
@restriction @restriction-way @overlap @geometry
|
2017-08-01 08:58:31 -04:00
|
|
|
Scenario: Duplicated restriction
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
c
|
|
|
|
|
|
|
|
|
| f
|
|
|
|
| |
|
|
|
|
b-g-e
|
|
|
|
| |
|
|
|
|
| d
|
|
|
|
|
|
|
|
|
a
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| ab |
|
|
|
|
| bc |
|
|
|
|
| bge |
|
|
|
|
| de |
|
|
|
|
| ef |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction |
|
|
|
|
| restriction | bge | ef | e | no_left_turn |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:via | way:to | restriction |
|
|
|
|
| restriction | ab | bge | de | no_right_turn |
|
|
|
|
| restriction | bc | bge | ef | no_left_turn |
|
|
|
|
|
|
|
|
When I route I should get
|
|
|
|
| from | to | route |
|
|
|
|
| a | d | ab,bc,bc,bge,de,de |
|
2018-02-09 13:32:09 -05:00
|
|
|
|
|
|
|
|
|
|
|
Scenario: Ambiguous ways
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
x---a----b-----c---z
|
|
|
|
|
|
|
|
|
d
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| abc |
|
|
|
|
| bd |
|
|
|
|
| xa |
|
|
|
|
| cz |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction |
|
|
|
|
| restriction | bd | abc | b | no_left_turn |
|
|
|
|
|
|
|
|
When I route I should get
|
|
|
|
| from | to | route |
|
|
|
|
| d | x | bd,abc,xa,xa |
|
|
|
|
| d | z | bd,abc,cz,cz |
|
2022-08-22 07:58:16 -04:00
|
|
|
|
|
|
|
|
|
|
|
Scenario: Multiple restricted entrances
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
b
|
|
|
|
|
|
|
|
|
a----e----c
|
|
|
|
|
|
|
|
|
d
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| ae |
|
|
|
|
| be |
|
|
|
|
| ce |
|
|
|
|
| de |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction |
|
|
|
|
| restriction | ae,be | ed | e | no_entry |
|
|
|
|
|
|
|
|
When I route I should get
|
|
|
|
| from | to | route |
|
|
|
|
| a | d | ae,ce,ce,de,de |
|
|
|
|
| b | d | be,ce,ce,de,de |
|
|
|
|
| c | d | ce,de,de |
|
|
|
|
|
|
|
|
|
|
|
|
Scenario: Multiple restricted exits
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
b
|
|
|
|
|
|
|
|
|
a----e----c
|
|
|
|
|
|
|
|
|
d
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| ae |
|
|
|
|
| be |
|
|
|
|
| ce |
|
|
|
|
| de |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction |
|
|
|
|
| restriction | ae | ce,de | e | no_exit |
|
|
|
|
|
|
|
|
When I route I should get
|
|
|
|
| from | to | route |
|
|
|
|
| a | b | ae,be,be |
|
|
|
|
| a | c | ae,be,be,ce,ce |
|
|
|
|
| a | d | ae,be,be,de,de |
|
|
|
|
|
|
|
|
|
|
|
|
Scenario: Invalid restricted entrances/exits
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
b
|
|
|
|
|
|
|
|
|
a----e----c
|
|
|
|
|
|
|
|
|
d
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| ae |
|
|
|
|
| be |
|
|
|
|
| ce |
|
|
|
|
| de |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction |
|
|
|
|
| restriction | ae | ce,de | e | no_entry |
|
|
|
|
| restriction | ae,be | ed | e | no_exit |
|
|
|
|
|
|
|
|
When I route I should get
|
|
|
|
| from | to | route |
|
|
|
|
| a | b | ae,be,be |
|
|
|
|
| a | c | ae,ce,ce |
|
|
|
|
| a | d | ae,de,de |
|
|
|
|
| b | d | be,de,de |
|
|
|
|
| c | d | ce,de,de |
|
|
|
|
|
|
|
|
|
|
|
|
Scenario: Invalid multi from/to restrictions
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
b
|
|
|
|
|
|
|
|
|
a----e----c
|
|
|
|
|
|
|
|
|
d
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| ae |
|
|
|
|
| be |
|
|
|
|
| ce |
|
|
|
|
| de |
|
|
|
|
|
|
|
|
And the relations
|
|
|
|
| type | way:from | way:to | node:via | restriction |
|
|
|
|
| restriction | ae,de | ce,de | e | no_right_turn |
|
|
|
|
| restriction | ae,be | ce,de | e | no_straight_on |
|
|
|
|
| restriction | ae,be | be,ce | e | only_left_turn |
|
|
|
|
| restriction | ae,be | ce,de | e | only_straight_on |
|
|
|
|
|
|
|
|
When I route I should get
|
|
|
|
| from | to | route |
|
|
|
|
| a | b | ae,be,be |
|
|
|
|
| a | c | ae,ce,ce |
|
|
|
|
| a | d | ae,de,de |
|
|
|
|
| b | d | be,de,de |
|
|
|
|
| c | d | ce,de,de |
|