-
Notifications
You must be signed in to change notification settings - Fork 3.5k
/
Copy pathannotations.feature
118 lines (94 loc) · 3.75 KB
/
annotations.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
@routing @speed @annotations
Feature: Annotations
Scenario: Ensure that turn penalties aren't included in annotations
Given the profile "turnbot"
Given a grid size of 100 meters
Given the node map
"""
h i
j k l m
"""
And the query options
| annotations | duration,speed,weight,nodes |
And the ways
| nodes | highway |
| hk | residential |
| il | residential |
| jk | residential |
| lk | residential |
| lm | residential |
When I route I should get
| from | to | route | a:speed | a:weight | a:nodes |
| h | j | hk,jk,jk | 6.7:6.7 | 15:15 | 1:4:3 |
| i | m | il,lm,lm | 6.7:6.7 | 15:15 | 2:5:6 |
| j | m | jk,lm | 6.7:6.7:6.7 | 15:15:15 | 3:4:5:6 |
Scenario: There should be different forward/reverse datasources
Given the profile "testbot"
And the node map
"""
a b c d e f g h i
"""
And the ways
| nodes | highway |
| abcdefghi | primary |
And the contract extra arguments "--segment-speed-file {speeds_file}"
And the customize extra arguments "--segment-speed-file {speeds_file}"
# Note: 180km/h == 50m/s for speed annotations
And the speed file
"""
1,2,180,1
2,1,180,1
3,4,180,1
5,6,180,1
8,7,180,1
"""
And the query options
| annotations | datasources,speed |
When I route I should get
| from | to | route | a:datasources | a:speed |
| a | i | abcdefghi,abcdefghi | 1:0:1:0:1:0:0:0 | 50:10:50:10:50:10:10:10 |
| i | a | abcdefghi,abcdefghi | 0:1:0:0:0:0:0:1 | 10:50:10:10:10:10:10:50 |
Scenario: datasource name annotations
Given the profile "testbot"
And the node map
"""
a b c
"""
And the ways
| nodes |
| abc |
And the contract extra arguments "--segment-speed-file {speeds_file}"
And the customize extra arguments "--segment-speed-file {speeds_file}"
And the speed file
"""
1,2,180,1
2,1,180,1
"""
And the query options
| annotations | datasources |
# Note - the source names here are specific to how the tests are constructed,
# so if this test is moved around (changes line number) or support code
# changes how the filenames are generated, this test will need to be updated
When I route I should get
| from | to | route | am:datasource_names |
| a | c | abc,abc | lua profile:63_datasource_name_annotations_speeds |
| c | a | abc,abc | lua profile:63_datasource_name_annotations_speeds |
Scenario: Speed annotations should handle zero segments
Given the profile "testbot"
Given the node map
"""
a -- b --- c
|
d
"""
And the ways
| nodes |
| abc |
| cd |
# This test relies on the snapping to the EBN cd to introduce a zero segment after the turn
And the query options
| annotations | speed,distance,duration,nodes |
| bearings | 90,5;180,5 |
When I route I should get
| from | to | route | a:speed | a:distance | a:duration | a:nodes |
| a | c | abc,abc | 10:10 | 249.9876189:299.962882 +- 1e-7 | 25:30 | 1:2:3 |