Skip to content

Commit 4b24713

Browse files
committed
Support trunk access for some countries
1 parent becfd8a commit 4b24713

File tree

8 files changed

+494
-51
lines changed

8 files changed

+494
-51
lines changed

data/notrunk.geojson

Lines changed: 7 additions & 0 deletions
Large diffs are not rendered by default.

features/bicycle/way.feature

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Feature: Bike - Accessability of different way types
44
Background:
55
Given the profile "bicycle"
66

7-
Scenario: Bike - Routability of way types
7+
Scenario: Bike - Routability of way types trunk not supported
88
# Bikes are allowed on footways etc because you can pull your bike at a lower speed.
99
# Pier is not allowed, since it's tagged using man_made=pier.
1010

@@ -40,3 +40,40 @@ Feature: Bike - Accessability of different way types
4040
| highway | man_made | bothw |
4141
| (nil) | (nil) | |
4242
| (nil) | pier | x |
43+
44+
Scenario: Bike - Routability of way types trunk supported
45+
# Bikes are allowed on footways etc because you can pull your bike at a lower speed.
46+
# Pier is not allowed, since it's tagged using man_made=pier.
47+
48+
Given the profile file "bicycle" initialized with
49+
"""
50+
profile.uselocationtags.trunk = true
51+
"""
52+
53+
Then routability should be
54+
| highway | bothw |
55+
| (nil) | |
56+
| motorway | |
57+
| motorway_link | |
58+
| trunk | x |
59+
| trunk_link | x |
60+
| primary | x |
61+
| primary_link | x |
62+
| secondary | x |
63+
| secondary_link | x |
64+
| tertiary | x |
65+
| tertiary_link | x |
66+
| residential | x |
67+
| service | x |
68+
| unclassified | x |
69+
| living_street | x |
70+
| road | x |
71+
| track | x |
72+
| path | x |
73+
| footway | x |
74+
| pedestrian | x |
75+
| steps | x |
76+
| cycleway | x |
77+
| bridleway | |
78+
| pier | |
79+

features/bicycle/way_notrunk.feature

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
@testbot @way @notrunk
2+
Feature: Testbot - notrunk allowed
3+
4+
# Check that Nodes need to be in the geojson file to support trunk access.
5+
# Use the default geopoint around 0.0.
6+
# This covers both trunk allowed notrunk allowed and no motorroad
7+
8+
Scenario: bicycle trunk allowed - notrunk failure original behavior
9+
10+
Given the profile "bicycle"
11+
And the extract extra arguments "--threads 1"
12+
And the partition extra arguments "--threads 1"
13+
And the customize extra arguments "--threads 1"
14+
15+
And the node locations
16+
# f through o should all fail
17+
18+
| node | lat | lon |
19+
| a | 48.65729 | 22.26471 |
20+
| b | 48.65648 | 22.26486 |
21+
| c | 48.65503 | 22.26521 |
22+
| d | 48.65489 | 22.26520 |
23+
| e | 48.65426 | 22.26533 |
24+
| f | 48.65277 | 22.26556 |
25+
| g | 48.65026 | 22.26606 |
26+
| h | 48.64937 | 22.26618 |
27+
| i | 48.64858 | 22.26634 |
28+
| j | 48.64763 | 22.26652 |
29+
| k | 48.64730 | 22.26658 |
30+
| l | 48.64616 | 22.26681 |
31+
| m | 48.64599 | 22.26685 |
32+
| n | 48.64568 | 22.26690 |
33+
34+
35+
And the ways
36+
| nodes | highway | motorroad |
37+
| ab | primary | |
38+
| bc | primary | |
39+
| cd | primary | yes |
40+
| de | primary | |
41+
| ef | primary | |
42+
| fg | trunk | |
43+
| gh | trunk | |
44+
| hi | trunk | |
45+
| ij | trunk | |
46+
| jk | trunk | |
47+
| kl | trunk | |
48+
| lm | trunk | yes |
49+
| mn | primary | |
50+
51+
When I route I should get
52+
| from | to | route | status| message | # |
53+
| a | c | ab,bc,bc | 200 | | |
54+
| a | f | | 400 | Impossible route between points | |
55+
| d | f | de,ef,ef | 200 | | |
56+
| d | g | de,ef,ef | 200 | | |
57+
| d | n | | 400 | Impossible route between points | |
58+
59+
Scenario: bicycle trunk allowed - trunk ok with no geojson
60+
61+
Given the extract extra arguments "--threads 1"
62+
And the partition extra arguments "--threads 1"
63+
And the customize extra arguments "--threads 1"
64+
65+
And the profile file "bicycle" initialized with
66+
"""
67+
profile.uselocationtags.trunk = true
68+
"""
69+
70+
And the node locations
71+
# a through g are in Slovakia - in the no trunk allowed set
72+
# h is on the edge (i.e. in Ukraine)
73+
# i through n are in Ukraine
74+
75+
| node | lat | lon |
76+
| a | 48.65729 | 22.26471 |
77+
| b | 48.65648 | 22.26486 |
78+
| c | 48.65503 | 22.26521 |
79+
| d | 48.65489 | 22.26520 |
80+
| e | 48.65426 | 22.26533 |
81+
| f | 48.65277 | 22.26556 |
82+
| g | 48.65026 | 22.26606 |
83+
| h | 48.64937 | 22.26618 |
84+
| i | 48.64858 | 22.26634 |
85+
| j | 48.64763 | 22.26652 |
86+
| k | 48.64730 | 22.26658 |
87+
| l | 48.64616 | 22.26681 |
88+
| m | 48.64599 | 22.26685 |
89+
| n | 48.64568 | 22.26690 |
90+
91+
92+
And the ways
93+
| nodes | highway | motorroad |
94+
| ab | primary | |
95+
| bc | primary | |
96+
| cd | primary | yes |
97+
| de | primary | |
98+
| ef | primary | |
99+
| fg | trunk | |
100+
| gh | trunk | |
101+
| hi | trunk | |
102+
| ij | trunk | |
103+
| jk | trunk | |
104+
| kl | trunk | |
105+
| lm | trunk | yes |
106+
| mn | primary | |
107+
108+
When I route I should get
109+
| from | to | route | status| message | # |
110+
| a | c | ab,bc,bc | 200 | | |
111+
| a | d | | 400 | Impossible route between points | |
112+
| d | f | de,ef,ef | 200 | | |
113+
| d | g | de,ef,fg,fg | 200 | | |
114+
| e | n | | 400 | Impossible route between points | |
115+
| f | h | fg,gh | 200 | | |
116+
| g | l | gh,ij,kl,kl | 200 | | |
117+
| h | l | hi,ij,kl,kl | 200 | | |
118+
| i | l | ij,kl,kl | 200 | | |
119+
| i | m | | 400 | Impossible route between points | |
120+
121+
Scenario: bicycle trunk allowed - notrunk failure with geojson
122+
123+
Given the extract extra arguments "--threads 1 --location-dependent-data data/notrunk.geojson"
124+
And the partition extra arguments "--threads 1"
125+
And the customize extra arguments "--threads 1"
126+
127+
And the profile file "bicycle" initialized with
128+
"""
129+
profile.uselocationtags.trunk = true
130+
"""
131+
132+
And the node locations
133+
# a through g are in Slovakia - in the no trunk allowed set
134+
# h is on the edge (i.e. in Ukraine)
135+
# i through n are in Ukraine
136+
137+
| node | lat | lon |
138+
| a | 48.65729 | 22.26471 |
139+
| b | 48.65648 | 22.26486 |
140+
| c | 48.65503 | 22.26521 |
141+
| d | 48.65489 | 22.26520 |
142+
| e | 48.65426 | 22.26533 |
143+
| f | 48.65277 | 22.26556 |
144+
| g | 48.65026 | 22.26606 |
145+
| h | 48.64937 | 22.26618 |
146+
| i | 48.64858 | 22.26634 |
147+
| j | 48.64763 | 22.26652 |
148+
| k | 48.64730 | 22.26658 |
149+
| l | 48.64616 | 22.26681 |
150+
| m | 48.64599 | 22.26685 |
151+
| n | 48.64568 | 22.26690 |
152+
153+
154+
And the ways
155+
| nodes | highway | motorroad |
156+
| ab | primary | |
157+
| bc | primary | |
158+
| cd | primary | yes |
159+
| de | primary | |
160+
| ef | primary | |
161+
| fg | trunk | |
162+
| gh | trunk | |
163+
| hi | trunk | |
164+
| ij | trunk | |
165+
| jk | trunk | |
166+
| kl | trunk | |
167+
| lm | trunk | yes |
168+
| mn | primary | |
169+
170+
When I route I should get
171+
| from | to | route | status| message | # |
172+
| a | c | ab,bc,bc | 200 | | |
173+
| a | d | | 400 | Impossible route between points | |
174+
| a | f | | 400 | Impossible route between points | |
175+
| d | f | de,ef,ef | 200 | | |
176+
| d | g | | 400 | Impossible route between points | |
177+
| e | n | | 400 | Impossible route between points | |
178+
| f | h | | 400 | Impossible route between points | |
179+
| g | l | hi,ij,kl,kl | 200 | | |
180+
| h | l | hi,ij,kl,kl | 200 | | |
181+
| i | l | ij,kl,kl | 200 | | |
182+
| i | m | | 400 | Impossible route between points | |
183+

features/foot/way.feature

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,37 @@ Feature: Foot - Accessability of different way types
4242
| footway | | | x |
4343
| proposed | | | |
4444
| proposed | yes | yes | |
45+
46+
Scenario: Foot - Basic access with profile.uselocationtags.trunk = true
47+
48+
Given the profile file "foot" initialized with
49+
"""
50+
profile.uselocationtags.trunk = true
51+
"""
52+
53+
Then routability should be
54+
| highway | forw |
55+
| motorway | |
56+
| motorway_link | |
57+
| trunk | x |
58+
| trunk_link | x |
59+
| primary | x |
60+
| primary_link | x |
61+
| secondary | x |
62+
| secondary_link | x |
63+
| tertiary | x |
64+
| tertiary_link | x |
65+
| residential | x |
66+
| service | x |
67+
| unclassified | x |
68+
| living_street | x |
69+
| road | x |
70+
| track | x |
71+
| path | x |
72+
| footway | x |
73+
| pedestrian | x |
74+
| steps | x |
75+
| pier | x |
76+
| cycleway | |
77+
| bridleway | |
78+

0 commit comments

Comments
 (0)