2014-10-09 08:30:06 -04:00
|
|
|
|
@routing @basic @testbot
|
2012-02-14 11:21:07 -05:00
|
|
|
|
Feature: Basic Routing
|
2013-08-05 13:00:09 -04:00
|
|
|
|
|
2013-08-29 13:29:13 -04:00
|
|
|
|
Background:
|
|
|
|
|
Given the profile "testbot"
|
|
|
|
|
|
|
|
|
|
@smallest
|
|
|
|
|
Scenario: A single way with two nodes
|
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
|
"""
|
|
|
|
|
a b
|
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
|
| nodes |
|
|
|
|
|
| ab |
|
|
|
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 17:32:00 -04:00
|
|
|
|
| from | to | route |
|
|
|
|
|
| a | b | ab,ab |
|
|
|
|
|
| b | a | ab,ab |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
|
|
Scenario: Routing in between two nodes of way
|
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
|
"""
|
|
|
|
|
a b 1 2 c d
|
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
|
| nodes |
|
|
|
|
|
| abcd |
|
|
|
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 17:32:00 -04:00
|
|
|
|
| from | to | route |
|
|
|
|
|
| 1 | 2 | abcd,abcd |
|
|
|
|
|
| 2 | 1 | abcd,abcd |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
|
|
Scenario: Routing between the middle nodes of way
|
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
|
"""
|
|
|
|
|
a b c d e f
|
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
|
| nodes |
|
|
|
|
|
| abcdef |
|
|
|
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 17:32:00 -04:00
|
|
|
|
| from | to | route |
|
|
|
|
|
| b | c | abcdef,abcdef |
|
|
|
|
|
| b | d | abcdef,abcdef |
|
|
|
|
|
| b | e | abcdef,abcdef |
|
|
|
|
|
| c | b | abcdef,abcdef |
|
|
|
|
|
| c | d | abcdef,abcdef |
|
|
|
|
|
| c | e | abcdef,abcdef |
|
|
|
|
|
| d | b | abcdef,abcdef |
|
|
|
|
|
| d | c | abcdef,abcdef |
|
|
|
|
|
| d | e | abcdef,abcdef |
|
|
|
|
|
| e | b | abcdef,abcdef |
|
|
|
|
|
| e | c | abcdef,abcdef |
|
|
|
|
|
| e | d | abcdef,abcdef |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
|
|
Scenario: Two ways connected in a straight line
|
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
|
"""
|
|
|
|
|
a b c
|
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
|
| nodes |
|
|
|
|
|
| ab |
|
|
|
|
|
| bc |
|
|
|
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 17:32:00 -04:00
|
|
|
|
| from | to | route |
|
|
|
|
|
| a | c | ab,bc,bc |
|
|
|
|
|
| c | a | bc,ab,ab |
|
|
|
|
|
| a | b | ab,ab |
|
|
|
|
|
| b | a | ab,ab |
|
|
|
|
|
| b | c | bc,bc |
|
|
|
|
|
| c | b | bc,bc |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
|
|
Scenario: 2 unconnected parallel ways
|
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
|
"""
|
|
|
|
|
a b c
|
|
|
|
|
d e f
|
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
|
| nodes |
|
|
|
|
|
| abc |
|
|
|
|
|
| def |
|
|
|
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 17:32:00 -04:00
|
|
|
|
| from | to | route |
|
|
|
|
|
| a | b | abc,abc |
|
|
|
|
|
| b | a | abc,abc |
|
|
|
|
|
| b | c | abc,abc |
|
|
|
|
|
| c | b | abc,abc |
|
|
|
|
|
| d | e | def,def |
|
|
|
|
|
| e | d | def,def |
|
|
|
|
|
| e | f | def,def |
|
|
|
|
|
| f | e | def,def |
|
|
|
|
|
| a | d | |
|
|
|
|
|
| d | a | |
|
|
|
|
|
| b | d | |
|
|
|
|
|
| d | b | |
|
|
|
|
|
| c | d | |
|
|
|
|
|
| d | c | |
|
|
|
|
|
| a | e | |
|
|
|
|
|
| e | a | |
|
|
|
|
|
| b | e | |
|
|
|
|
|
| e | b | |
|
|
|
|
|
| c | e | |
|
|
|
|
|
| e | c | |
|
|
|
|
|
| a | f | |
|
|
|
|
|
| f | a | |
|
|
|
|
|
| b | f | |
|
|
|
|
|
| f | b | |
|
|
|
|
|
| c | f | |
|
|
|
|
|
| f | c | |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
|
|
Scenario: 3 ways connected in a triangle
|
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
|
"""
|
|
|
|
|
a b
|
|
|
|
|
|
|
|
|
|
c
|
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
|
| nodes |
|
|
|
|
|
| ab |
|
|
|
|
|
| bc |
|
|
|
|
|
| ca |
|
|
|
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 17:32:00 -04:00
|
|
|
|
| from | to | route |
|
|
|
|
|
| a | b | ab,ab |
|
|
|
|
|
| a | c | ca,ca |
|
|
|
|
|
| b | c | bc,bc |
|
|
|
|
|
| b | a | ab,ab |
|
|
|
|
|
| c | a | ca,ca |
|
|
|
|
|
| c | b | bc,bc |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
|
|
Scenario: 3 connected triangles
|
|
|
|
|
Given a grid size of 100 meters
|
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
|
"""
|
|
|
|
|
x a b s
|
|
|
|
|
y t
|
|
|
|
|
c
|
|
|
|
|
v w
|
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
|
| nodes |
|
|
|
|
|
| ab |
|
|
|
|
|
| bc |
|
|
|
|
|
| ca |
|
|
|
|
|
| ax |
|
|
|
|
|
| xy |
|
|
|
|
|
| ya |
|
|
|
|
|
| bs |
|
|
|
|
|
| st |
|
|
|
|
|
| tb |
|
|
|
|
|
| cv |
|
|
|
|
|
| vw |
|
|
|
|
|
| wc |
|
|
|
|
|
|
|
|
|
|
When I route I should get
|
|
|
|
|
| from | to | route |
|
2016-03-31 17:32:00 -04:00
|
|
|
|
| a | b | ab,ab |
|
|
|
|
|
| a | c | ca,ca |
|
|
|
|
|
| b | c | bc,bc |
|
|
|
|
|
| b | a | ab,ab |
|
|
|
|
|
| c | a | ca,ca |
|
|
|
|
|
| c | b | bc,bc |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
|
|
Scenario: To ways connected at a 45 degree angle
|
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
|
"""
|
|
|
|
|
a
|
|
|
|
|
b
|
|
|
|
|
c d e
|
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
|
| nodes |
|
|
|
|
|
| abc |
|
|
|
|
|
| cde |
|
|
|
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 17:32:00 -04:00
|
|
|
|
| from | to | route |
|
|
|
|
|
| b | d | abc,cde,cde |
|
|
|
|
|
| a | e | abc,cde,cde |
|
|
|
|
|
| a | c | abc,abc |
|
|
|
|
|
| c | a | abc,abc |
|
|
|
|
|
| c | e | cde,cde |
|
|
|
|
|
| e | c | cde,cde |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
|
|
Scenario: Grid city center
|
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
|
"""
|
|
|
|
|
a b c d
|
|
|
|
|
e f g h
|
|
|
|
|
i j k l
|
|
|
|
|
m n o p
|
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
|
| nodes |
|
|
|
|
|
| abcd |
|
|
|
|
|
| efgh |
|
|
|
|
|
| ijkl |
|
|
|
|
|
| mnop |
|
|
|
|
|
| aeim |
|
|
|
|
|
| bfjn |
|
|
|
|
|
| cgko |
|
|
|
|
|
| dhlp |
|
|
|
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 17:32:00 -04:00
|
|
|
|
| from | to | route |
|
|
|
|
|
| f | g | efgh,efgh |
|
|
|
|
|
| g | f | efgh,efgh |
|
|
|
|
|
| f | j | bfjn,bfjn |
|
|
|
|
|
| j | f | bfjn,bfjn |
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
|
|
Scenario: Grid city periphery
|
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
|
"""
|
|
|
|
|
a b c d
|
|
|
|
|
e f g h
|
|
|
|
|
i j k l
|
|
|
|
|
m n o p
|
|
|
|
|
"""
|
2013-08-29 13:29:13 -04:00
|
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
|
| nodes |
|
|
|
|
|
| abcd |
|
|
|
|
|
| efgh |
|
|
|
|
|
| ijkl |
|
|
|
|
|
| mnop |
|
|
|
|
|
| aeim |
|
|
|
|
|
| bfjn |
|
|
|
|
|
| cgko |
|
|
|
|
|
| dhlp |
|
|
|
|
|
|
|
|
|
|
When I route I should get
|
2016-03-31 17:32:00 -04:00
|
|
|
|
| from | to | route |
|
|
|
|
|
| a | d | abcd,abcd |
|
|
|
|
|
| d | a | abcd,abcd |
|
|
|
|
|
| a | m | aeim,aeim |
|
|
|
|
|
| m | a | aeim,aeim |
|
2016-07-05 14:29:04 -04:00
|
|
|
|
|
2013-09-05 14:00:42 -04:00
|
|
|
|
Scenario: Testbot - Triangle challenge
|
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
|
"""
|
|
|
|
|
d
|
|
|
|
|
a b c
|
|
|
|
|
e
|
|
|
|
|
"""
|
2013-09-05 14:00:42 -04:00
|
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
|
| nodes | highway | oneway |
|
|
|
|
|
| abc | primary | |
|
|
|
|
|
| cd | primary | yes |
|
|
|
|
|
| ce | river | |
|
|
|
|
|
| de | primary | |
|
|
|
|
|
|
|
|
|
|
When I route I should get
|
|
|
|
|
| from | to | route |
|
2016-03-31 17:32:00 -04:00
|
|
|
|
| d | c | de,ce,ce |
|
|
|
|
|
| e | d | de,de |
|
2016-07-05 14:29:04 -04:00
|
|
|
|
|
|
|
|
|
Scenario: Ambiguous edge weights - Use minimal edge weight
|
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
|
"""
|
|
|
|
|
a b
|
|
|
|
|
"""
|
2016-07-05 14:29:04 -04:00
|
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
|
| nodes | highway | name |
|
|
|
|
|
| ab | tertiary | |
|
|
|
|
|
| ab | primary | |
|
|
|
|
|
| ab | secondary | |
|
|
|
|
|
|
|
|
|
|
When I route I should get
|
|
|
|
|
| from | to | route | time |
|
|
|
|
|
| a | b | , | 10s |
|
|
|
|
|
| b | a | , | 10s |
|
2016-07-05 14:08:21 -04:00
|
|
|
|
|
|
|
|
|
Scenario: Ambiguous edge names - Use lexicographically smallest name
|
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
|
"""
|
|
|
|
|
a b c
|
|
|
|
|
"""
|
2016-07-05 14:08:21 -04:00
|
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
|
| nodes | highway | name |
|
|
|
|
|
| ab | primary | |
|
|
|
|
|
| ab | primary | Αβγ |
|
|
|
|
|
| ab | primary | |
|
|
|
|
|
| ab | primary | Abc |
|
|
|
|
|
| ab | primary | |
|
|
|
|
|
| ab | primary | Абв |
|
|
|
|
|
| bc | primary | Ηθι |
|
|
|
|
|
| bc | primary | Δεζ |
|
|
|
|
|
| bc | primary | Где |
|
|
|
|
|
|
|
|
|
|
When I route I should get
|
|
|
|
|
| from | to | route |
|
|
|
|
|
| a | c | Abc,Δεζ,Δεζ |
|
|
|
|
|
| c | a | Δεζ,Abc,Abc |
|