Skip to content

Commit 35ef2de

Browse files
committed
bdd: change handling of untagged nodes
Nodes defined in the grid are now added to the import data only when the grid is defined, not when the final OPL is generated. This avoids untagged nodes being added again when running updates.
1 parent 7629962 commit 35ef2de

12 files changed

+76
-137
lines changed

tests/bdd/flex/expire.feature

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ Feature: Changes on way with expire on zoom 0
2626
"""
2727
w10 v1 dV Ta=b Nn10,n11
2828
"""
29-
And an empty grid
3029

3130
When running osm2pgsql flex with parameters
3231
| --slim | -a |
@@ -43,7 +42,6 @@ Feature: Changes on way with expire on zoom 0
4342
"""
4443
n1 v2 dV x1 y2
4544
"""
46-
And an empty grid
4745

4846
When running osm2pgsql flex with parameters
4947
| --slim | -a |
@@ -60,7 +58,6 @@ Feature: Changes on way with expire on zoom 0
6058
"""
6159
w10 v1 dV Tt1=yes Nn10,n11
6260
"""
63-
And an empty grid
6461

6562
When running osm2pgsql flex with parameters
6663
| --slim | -a |
@@ -79,7 +76,6 @@ Feature: Changes on way with expire on zoom 0
7976
"""
8077
w11 v2 dV Ta=b Nn10,n11
8178
"""
82-
And an empty grid
8379

8480
When running osm2pgsql flex with parameters
8581
| --slim | -a |
@@ -96,7 +92,6 @@ Feature: Changes on way with expire on zoom 0
9692
"""
9793
w11 v2 dD
9894
"""
99-
And an empty grid
10095

10196
When running osm2pgsql flex with parameters
10297
| --slim | -a |

tests/bdd/flex/locator.feature

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,7 @@ Feature: Locators
199199
| way_id | region | ST_AsText(geom) |
200200
| 20 | P1 | (10 0,20 10,10 10,10 0) |
201201

202-
Given an empty grid
203-
And the OSM data
202+
Given the OSM data
204203
"""
205204
n10 v1 dV Tamenity=post_box x15.0 y8.0
206205
n11 v1 dV Tamenity=post_box x15.0 y2.0

tests/bdd/flex/node-add.feature

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ Feature: Adding nodes to a flex database
2727

2828

2929
Scenario: node is not relevant
30-
Given an empty grid
31-
And the OSM data
30+
Given the OSM data
3231
"""
3332
n10 v1 dV Tt=ag x0 y0
3433
r30 v2 dV Tt=ag Mn10@,n11@,n12@mark,n13@,n14@mark
@@ -49,8 +48,7 @@ Feature: Adding nodes to a flex database
4948

5049

5150
Scenario: add to t1
52-
Given an empty grid
53-
And the OSM data
51+
Given the OSM data
5452
"""
5553
n10 v1 dV Tt1=yes x0 y0
5654
r30 v2 dV Tt=ag Mn10@,n11@,n12@mark,n13@,n14@mark
@@ -72,8 +70,7 @@ Feature: Adding nodes to a flex database
7270

7371

7472
Scenario: add to t2
75-
Given an empty grid
76-
And the OSM data
73+
Given the OSM data
7774
"""
7875
n10 v1 dV Tt2=yes x0 y0
7976
r30 v2 dV Tt=ag Mn10@mark,n11@,n12@mark,n13@,n14@mark
@@ -95,8 +92,7 @@ Feature: Adding nodes to a flex database
9592

9693

9794
Scenario: add to t1 and t2
98-
Given an empty grid
99-
And the OSM data
95+
Given the OSM data
10096
"""
10197
n10 v1 dV Tt1=yes,t2=yes x0 y0
10298
r30 v2 dV Tt=ag Mn10@mark,n11@,n12@mark,n13@,n14@mark
@@ -119,8 +115,7 @@ Feature: Adding nodes to a flex database
119115

120116

121117
Scenario: add to tboth (only stage1)
122-
Given an empty grid
123-
And the OSM data
118+
Given the OSM data
124119
"""
125120
n10 v1 dV Ttboth=yes x0 y0
126121
r30 v2 dV Tt=ag Mn10@,n11@,n12@mark,n13@,n14@mark
@@ -142,8 +137,7 @@ Feature: Adding nodes to a flex database
142137

143138

144139
Scenario: add to tboth (stage1 and stage2)
145-
Given an empty grid
146-
And the OSM data
140+
Given the OSM data
147141
"""
148142
n10 v1 dV Ttboth=yes x0 y0
149143
r30 v2 dV Tt=ag Mn10@mark,n11@,n12@mark,n13@,n14@mark

tests/bdd/flex/relation-changes.feature

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ Feature: Handling changes to relations
3232
| --slim |
3333
Then table osm2pgsql_test_relations has 0 rows
3434

35-
Given an empty grid
36-
And the OSM data
35+
Given the OSM data
3736
"""
3837
r30 v2 dV Ttype=multipolygon Mw20@,w21@
3938
"""
@@ -56,8 +55,7 @@ Feature: Handling changes to relations
5655
| --slim |
5756
Then table osm2pgsql_test_relations has 0 rows
5857

59-
Given an empty grid
60-
And the OSM data
58+
Given the OSM data
6159
"""
6260
w21 v2 dV Nn12,n13,n10
6361
"""
@@ -79,8 +77,7 @@ Feature: Handling changes to relations
7977
| --slim |
8078
Then table osm2pgsql_test_relations has 0 rows
8179

82-
Given an empty grid
83-
And the OSM data
80+
Given the OSM data
8481
"""
8582
n12 v2 dV x10.1 y10.1
8683
"""
@@ -103,8 +100,7 @@ Feature: Handling changes to relations
103100
| --slim |
104101
Then table osm2pgsql_test_relations has 0 rows
105102

106-
Given an empty grid
107-
And the OSM data
103+
Given the OSM data
108104
"""
109105
r30 v2 dV Ttype=multipolygon Mw20@,w21@
110106
"""
@@ -127,8 +123,7 @@ Feature: Handling changes to relations
127123
| --slim |
128124
Then table osm2pgsql_test_relations has 1 row
129125

130-
Given an empty grid
131-
And the OSM data
126+
Given the OSM data
132127
"""
133128
r30 v2 dV Mw20@,w21@
134129
"""
@@ -151,8 +146,7 @@ Feature: Handling changes to relations
151146
| --slim |
152147
Then table osm2pgsql_test_relations has 1 row
153148

154-
Given an empty grid
155-
And the OSM data
149+
Given the OSM data
156150
"""
157151
w21 v2 dV <new nodelist>
158152
"""
@@ -180,8 +174,7 @@ Feature: Handling changes to relations
180174
| --slim |
181175
Then table osm2pgsql_test_relations has 1 row
182176

183-
Given an empty grid
184-
And the OSM data
177+
Given the OSM data
185178
"""
186179
n12 v2 dV <new coordinates>
187180
"""
@@ -209,8 +202,7 @@ Feature: Handling changes to relations
209202
| --slim |
210203
Then table osm2pgsql_test_relations has 1 row
211204

212-
Given an empty grid
213-
And the OSM data
205+
Given the OSM data
214206
"""
215207
r30 v2 dV Ttype=multipolygon <new memberlist>
216208
"""
@@ -240,8 +232,7 @@ Feature: Handling changes to relations
240232
| area_id | tags->'natural' | tags->'landuse' |
241233
| -30 | wood | NULL |
242234

243-
Given an empty grid
244-
And the OSM data
235+
Given the OSM data
245236
"""
246237
r30 v2 dV Ttype=multipolygon,landuse=forest Mw20@,w21@
247238
"""

tests/bdd/flex/way-add.feature

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ Feature: Adding ways to a flex database
3131

3232

3333
Scenario: way is not relevant
34-
Given an empty grid
35-
And the OSM data
34+
Given the OSM data
3635
"""
3736
w10 v1 dV Tt=ag Nn10,n11
3837
r30 v2 dV Tt=ag Mw10@,w11@,w12@mark,w13@,w14@mark
@@ -53,8 +52,7 @@ Feature: Adding ways to a flex database
5352

5453

5554
Scenario: add to t1
56-
Given an empty grid
57-
And the OSM data
55+
Given the OSM data
5856
"""
5957
w10 v1 dV Tt1=yes Nn10,n11
6058
r30 v2 dV Tt=ag Mw10@,w11@,w12@mark,w13@,w14@mark
@@ -76,8 +74,7 @@ Feature: Adding ways to a flex database
7674

7775

7876
Scenario: add to t2
79-
Given an empty grid
80-
And the OSM data
77+
Given the OSM data
8178
"""
8279
w10 v1 dV Tt2=yes Nn10,n11
8380
r30 v2 dV Tt=ag Mw10@mark,w11@,w12@mark,w13@,w14@mark
@@ -99,8 +96,7 @@ Feature: Adding ways to a flex database
9996

10097

10198
Scenario: add to t1 and t2
102-
Given an empty grid
103-
And the OSM data
99+
Given the OSM data
104100
"""
105101
w10 v1 dV Tt1=yes,t2=yes Nn10,n11
106102
r30 v2 dV Tt=ag Mw10@mark,w11@,w12@mark,w13@,w14@mark
@@ -123,8 +119,7 @@ Feature: Adding ways to a flex database
123119

124120

125121
Scenario: add to tboth (only stage1)
126-
Given an empty grid
127-
And the OSM data
122+
Given the OSM data
128123
"""
129124
w10 v1 dV Ttboth=yes Nn10,n11
130125
r30 v2 dV Tt=ag Mw10@,w11@,w12@mark,w13@,w14@mark
@@ -146,8 +141,7 @@ Feature: Adding ways to a flex database
146141

147142

148143
Scenario: add to tboth (stage1 and stage2)
149-
Given an empty grid
150-
And the OSM data
144+
Given the OSM data
151145
"""
152146
w10 v1 dV Ttboth=yes Nn10,n11
153147
r30 v2 dV Tt=ag Mw10@mark,w11@,w12@mark,w13@,w14@mark

tests/bdd/flex/way-change.feature

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ Feature: Changing ways in a flex database
3131
| 13 |
3232
| 14 |
3333

34-
Given an empty grid
35-
And the OSM data
34+
Given the OSM data
3635
"""
3736
<input>
3837
"""
@@ -84,8 +83,7 @@ Feature: Changing ways in a flex database
8483
| 13 |
8584
| 14 |
8685

87-
Given an empty grid
88-
And the OSM data
86+
Given the OSM data
8987
"""
9088
<input>
9189
"""
@@ -138,8 +136,7 @@ Feature: Changing ways in a flex database
138136
| 13 |
139137
| 14 |
140138

141-
Given an empty grid
142-
And the OSM data
139+
Given the OSM data
143140
"""
144141
<input>
145142
"""
@@ -196,8 +193,7 @@ Feature: Changing ways in a flex database
196193
| 13 | NULL |
197194
| 14 | {30} |
198195

199-
Given an empty grid
200-
And the OSM data
196+
Given the OSM data
201197
"""
202198
<input>
203199
"""
@@ -243,8 +239,7 @@ Feature: Changing ways in a flex database
243239
| 13 | NULL |
244240
| 14 | {30} |
245241

246-
Given an empty grid
247-
And the OSM data
242+
Given the OSM data
248243
"""
249244
w10 v2 dV Tt1=yes,t2=yes,tboth=yes Nn10,n11
250245
"""

tests/bdd/flex/way-del.feature

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ Feature: Deleting ways in a 2-stage flex database
3131
| 13 |
3232
| 14 |
3333

34-
Given an empty grid
35-
And the OSM data
34+
Given the OSM data
3635
"""
3736
w10 v2 dD
3837
"""
@@ -74,8 +73,7 @@ Feature: Deleting ways in a 2-stage flex database
7473
| 13 |
7574
| 14 |
7675

77-
Given an empty grid
78-
And the OSM data
76+
Given the OSM data
7977
"""
8078
w10 v2 dD
8179
"""
@@ -117,8 +115,7 @@ Feature: Deleting ways in a 2-stage flex database
117115
| 13 |
118116
| 14 |
119117

120-
Given an empty grid
121-
And the OSM data
118+
Given the OSM data
122119
"""
123120
w10 v2 dD
124121
"""
@@ -159,8 +156,7 @@ Feature: Deleting ways in a 2-stage flex database
159156
| 13 |
160157
| 14 |
161158

162-
Given an empty grid
163-
And the OSM data
159+
Given the OSM data
164160
"""
165161
w10 v2 dD
166162
"""
@@ -202,8 +198,7 @@ Feature: Deleting ways in a 2-stage flex database
202198
| 13 |
203199
| 14 |
204200

205-
Given an empty grid
206-
And the OSM data
201+
Given the OSM data
207202
"""
208203
w10 v2 dD
209204
"""
@@ -245,8 +240,7 @@ Feature: Deleting ways in a 2-stage flex database
245240
| 13 |
246241
| 14 |
247242

248-
Given an empty grid
249-
And the OSM data
243+
Given the OSM data
250244
"""
251245
w10 v2 dD
252246
"""
@@ -289,8 +283,7 @@ Feature: Deleting ways in a 2-stage flex database
289283
| 13 |
290284
| 14 |
291285

292-
Given an empty grid
293-
And the OSM data
286+
Given the OSM data
294287
"""
295288
w10 v2 dD
296289
"""
@@ -332,8 +325,7 @@ Feature: Deleting ways in a 2-stage flex database
332325
| 13 |
333326
| 14 |
334327

335-
Given an empty grid
336-
And the OSM data
328+
Given the OSM data
337329
"""
338330
w10 v2 dD
339331
"""

0 commit comments

Comments
 (0)