2 Feature: Import of address interpolations
3 Tests that interpolated addresses are added correctly
5 Scenario: Simple even two point interpolation
7 | osm_id | class | type | housenumber | geometry
8 | 1 | place | house | 2 | 1 1
9 | 2 | place | house | 6 | 1 1.001
11 | osm_id | class | type | housenumber | geometry
12 | 1 | place | houses | even | 1 1, 1 1.001
17 Then way 1 expands to housenumbers
18 | housenumber | centroid
21 Scenario: Simple even two point interpolation with zero beginning
23 | osm_id | class | type | housenumber | geometry
24 | 1 | place | house | 0 | 1 1
25 | 2 | place | house | 8 | 1 1.001
27 | osm_id | class | type | housenumber | geometry
28 | 1 | place | houses | even | 1 1, 1 1.001
33 Then way 1 expands to housenumbers
34 | housenumber | centroid
39 Scenario: Backwards even two point interpolation
41 | osm_id | class | type | housenumber | geometry
42 | 1 | place | house | 2 | 1 1
43 | 2 | place | house | 6 | 1 1.001
45 | osm_id | class | type | housenumber | geometry
46 | 1 | place | houses | even | 1 1.001, 1 1
51 Then way 1 expands to housenumbers
52 | housenumber | centroid
55 Scenario: Even two point interpolation with odd beginning
57 | osm_id | class | type | housenumber | geometry
58 | 1 | place | house | 11 | 1 1
59 | 2 | place | house | 16 | 1 1.001
61 | osm_id | class | type | housenumber | geometry
62 | 1 | place | houses | even | 1 1, 1 1.001
67 Then way 1 expands to housenumbers
68 | housenumber | centroid
72 Scenario: Even two point interpolation with odd end
74 | osm_id | class | type | housenumber | geometry
75 | 1 | place | house | 10 | 1 1
76 | 2 | place | house | 15 | 1 1.001
78 | osm_id | class | type | housenumber | geometry
79 | 1 | place | houses | even | 1 1, 1 1.001
84 Then way 1 expands to housenumbers
85 | housenumber | centroid
89 Scenario: Reverse even two point interpolation with odd beginning
91 | osm_id | class | type | housenumber | geometry
92 | 1 | place | house | 11 | 1 1
93 | 2 | place | house | 16 | 1 1.001
95 | osm_id | class | type | housenumber | geometry
96 | 1 | place | houses | even | 1 1.001, 1 1
101 Then way 1 expands to housenumbers
102 | housenumber | centroid
106 Scenario: Reverse even two point interpolation with odd end
107 Given the place nodes
108 | osm_id | class | type | housenumber | geometry
109 | 1 | place | house | 10 | 1 1
110 | 2 | place | house | 15 | 1 1.001
112 | osm_id | class | type | housenumber | geometry
113 | 1 | place | houses | even | 1 1.001, 1 1
118 Then way 1 expands to housenumbers
119 | housenumber | centroid
123 Scenario: Simple odd two point interpolation
124 Given the place nodes
125 | osm_id | class | type | housenumber | geometry
126 | 1 | place | house | 1 | 1 1
127 | 2 | place | house | 11 | 1 1.001
129 | osm_id | class | type | housenumber | geometry
130 | 1 | place | houses | odd | 1 1, 1 1.001
135 Then way 1 expands to housenumbers
136 | housenumber | centroid
142 Scenario: Odd two point interpolation with even beginning
143 Given the place nodes
144 | osm_id | class | type | housenumber | geometry
145 | 1 | place | house | 2 | 1 1
146 | 2 | place | house | 7 | 1 1.001
148 | osm_id | class | type | housenumber | geometry
149 | 1 | place | houses | odd | 1 1, 1 1.001
154 Then way 1 expands to housenumbers
155 | housenumber | centroid
159 Scenario: Simple all two point interpolation
160 Given the place nodes
161 | osm_id | class | type | housenumber | geometry
162 | 1 | place | house | 1 | 1 1
163 | 2 | place | house | 3 | 1 1.001
165 | osm_id | class | type | housenumber | geometry
166 | 1 | place | houses | all | 1 1, 1 1.001
171 Then way 1 expands to housenumbers
172 | housenumber | centroid
175 Scenario: Simple numbered two point interpolation
176 Given the place nodes
177 | osm_id | class | type | housenumber | geometry
178 | 1 | place | house | 3 | 1 1
179 | 2 | place | house | 9 | 1 1.001
181 | osm_id | class | type | housenumber | geometry
182 | 1 | place | houses | 3 | 1 1, 1 1.001
187 Then way 1 expands to housenumbers
188 | housenumber | centroid
191 Scenario: Even two point interpolation with intermediate empty node
192 Given the place nodes
193 | osm_id | class | type | housenumber | geometry
194 | 1 | place | house | 2 | 1 1
195 | 2 | place | house | 10 | 1.001 1.001
197 | osm_id | class | type | housenumber | geometry
198 | 1 | place | houses | even | 1 1, 1 1.001, 1.001 1.001
203 Then way 1 expands to housenumbers
204 | housenumber | centroid
210 Scenario: Even two point interpolation with intermediate duplicated empty node
211 Given the place nodes
212 | osm_id | class | type | housenumber | geometry
213 | 1 | place | house | 2 | 1 1
214 | 2 | place | house | 10 | 1.001 1.001
216 | osm_id | class | type | housenumber | geometry
217 | 1 | place | houses | even | 1 1, 1 1.001, 1.001 1.001
222 Then way 1 expands to housenumbers
223 | housenumber | centroid
228 Scenario: Simple even three point interpolation
229 Given the place nodes
230 | osm_id | class | type | housenumber | geometry
231 | 1 | place | house | 2 | 1 1
232 | 2 | place | house | 14 | 1.001 1.001
233 | 3 | place | house | 10 | 1 1.001
235 | osm_id | class | type | housenumber | geometry
236 | 1 | place | houses | even | 1 1, 1 1.001, 1.001 1.001
241 Then way 1 expands to housenumbers
242 | housenumber | centroid
248 Scenario: Simple even four point interpolation
249 Given the place nodes
250 | osm_id | class | type | housenumber | geometry
251 | 1 | place | house | 2 | 1 1
252 | 2 | place | house | 14 | 1.001 1.001
253 | 3 | place | house | 10 | 1 1.001
254 | 4 | place | house | 18 | 1.001 1.002
256 | osm_id | class | type | housenumber | geometry
257 | 1 | place | houses | even | 1 1, 1 1.001, 1.001 1.001, 1.001 1.002
262 Then way 1 expands to housenumbers
263 | housenumber | centroid
270 Scenario: Reverse simple even three point interpolation
271 Given the place nodes
272 | osm_id | class | type | housenumber | geometry
273 | 1 | place | house | 2 | 1 1
274 | 2 | place | house | 14 | 1.001 1.001
275 | 3 | place | house | 10 | 1 1.001
277 | osm_id | class | type | housenumber | geometry
278 | 1 | place | houses | even | 1.001 1.001, 1 1.001, 1 1
283 Then way 1 expands to housenumbers
284 | housenumber | centroid
290 Scenario: Even three point interpolation with odd center point
291 Given the place nodes
292 | osm_id | class | type | housenumber | geometry
293 | 1 | place | house | 2 | 1 1
294 | 2 | place | house | 8 | 1.001 1.001
295 | 3 | place | house | 7 | 1 1.001
297 | osm_id | class | type | housenumber | geometry
298 | 1 | place | houses | even | 1 1, 1 1.001, 1.001 1.001
303 Then way 1 expands to housenumbers
304 | housenumber | centroid
308 Scenario: Interpolation on self-intersecting way
309 Given the place nodes
310 | osm_id | class | type | housenumber | geometry
311 | 1 | place | house | 2 | 0 0
312 | 2 | place | house | 6 | 0 0.001
313 | 3 | place | house | 10 | 0 0.002
315 | osm_id | class | type | housenumber | geometry
316 | 1 | place | houses | even | 0 0, 0 0.001, 0 0.002, 0 0.001
321 Then way 1 expands to housenumbers
322 | housenumber | centroid
326 Scenario: Interpolation on self-intersecting way II
327 Given the place nodes
328 | osm_id | class | type | housenumber | geometry
329 | 1 | place | house | 2 | 0 0
330 | 2 | place | house | 6 | 0 0.001
332 | osm_id | class | type | housenumber | geometry
333 | 1 | place | houses | even | 0 0, 0 0.001, 0 0.002, 0 0.001
338 Then way 1 expands to housenumbers
339 | housenumber | centroid
343 Scenario: addr:street on interpolation way
344 Given the scene parallel-road
346 | osm_id | class | type | housenumber | geometry
347 | 1 | place | house | 2 | :n-middle-w
348 | 2 | place | house | 6 | :n-middle-e
349 | 3 | place | house | 12 | :n-middle-w
350 | 4 | place | house | 16 | :n-middle-e
352 | osm_id | class | type | housenumber | street | geometry
353 | 10 | place | houses | even | | :w-middle
354 | 11 | place | houses | even | Cloud Street | :w-middle
356 | osm_id | class | type | name | geometry
357 | 2 | highway | tertiary | 'name' : 'Sun Way' | :w-north
358 | 3 | highway | tertiary | 'name' : 'Cloud Street' | :w-south
361 | 10 | 1,100,101,102,2
362 | 11 | 3,200,201,202,4
364 Then table placex contains
365 | object | parent_place_id
372 And way 10 expands exactly to housenumbers 4
373 And way 11 expands exactly to housenumbers 14
375 Scenario: addr:street on housenumber way
376 Given the scene parallel-road
378 | osm_id | class | type | housenumber | street | geometry
379 | 1 | place | house | 2 | | :n-middle-w
380 | 2 | place | house | 6 | | :n-middle-e
381 | 3 | place | house | 12 | Cloud Street | :n-middle-w
382 | 4 | place | house | 16 | Cloud Street | :n-middle-e
384 | osm_id | class | type | housenumber | geometry
385 | 10 | place | houses | even | :w-middle
386 | 11 | place | houses | even | :w-middle
388 | osm_id | class | type | name | geometry
389 | 2 | highway | tertiary | 'name' : 'Sun Way' | :w-north
390 | 3 | highway | tertiary | 'name' : 'Cloud Street' | :w-south
393 | 10 | 1,100,101,102,2
394 | 11 | 3,200,201,202,4
396 Then table placex contains
397 | object | parent_place_id
404 And way 10 expands exactly to housenumbers 4
405 And way 11 expands exactly to housenumbers 14
407 Scenario: Geometry of points and way don't match (github #253)
408 Given the place nodes
409 | osm_id | class | type | housenumber | geometry
410 | 1 | place | house | 10 | 144.9632341 -37.76163
411 | 2 | place | house | 6 | 144.9630541 -37.7628174
412 | 3 | shop | supermarket | 2 | 144.9629794 -37.7630755
414 | osm_id | class | type | housenumber | geometry
415 | 1 | place | houses | even | 144.9632341 -37.76163,144.9630541 -37.7628172,144.9629794 -37.7630755
420 Then way 1 expands to housenumbers
421 | housenumber | centroid
422 | 4 | 144.963016723312,-37.7629464422819+-0.000005
423 | 8 | 144.9631440856,-37.762223694978+-0.000005
425 Scenario: Place with missing address information
426 Given the place nodes
427 | osm_id | class | type | housenumber | geometry
428 | 1 | place | house | 23 | 0.0001 0.0001
429 | 2 | amenity | school | | 0.0001 0.0002
430 | 3 | place | house | 29 | 0.0001 0.0004
432 | osm_id | class | type | housenumber | geometry
433 | 1 | place | houses | odd | 0.0001 0.0001,0.0001 0.0002,0.0001 0.0004
438 Then way 1 expands to housenumbers
439 | housenumber | centroid