2 Feature: Import of address interpolations
3 Tests that interpolated addresses are added correctly
5 Scenario: Simple even interpolation line with two points
7 | osm_id | osm_type | class | type | housenumber | geometry
8 | 1 | N | place | house | 2 | 1 1
9 | 2 | N | place | house | 6 | 1 1.001
11 | osm_id | osm_type | class | type | housenumber | geometry
12 | 1 | W | place | houses | even | 1 1, 1 1.001
17 Then way 1 expands to lines
18 | startnumber | endnumber | geometry
19 | 2 | 6 | 1 1, 1 1.001
21 Scenario: Backwards even two point interpolation line
23 | osm_id | class | type | housenumber | geometry
24 | 1 | place | house | 2 | 1 1
25 | 2 | place | house | 6 | 1 1.001
27 | osm_id | class | type | housenumber | geometry
28 | 1 | place | houses | even | 1 1.001, 1 1
33 Then way 1 expands to lines
34 | startnumber | endnumber | geometry
35 | 2 | 6 | 1 1, 1 1.001
37 Scenario: Simple odd two point interpolation
39 | osm_id | class | type | housenumber | geometry
40 | 1 | place | house | 1 | 1 1
41 | 2 | place | house | 11 | 1 1.001
43 | osm_id | class | type | housenumber | geometry
44 | 1 | place | houses | odd | 1 1, 1 1.001
49 Then way 1 expands to lines
50 | startnumber | endnumber | geometry
51 | 1 | 11 | 1 1, 1 1.001
53 Scenario: Simple all two point interpolation
55 | osm_id | class | type | housenumber | geometry
56 | 1 | place | house | 1 | 1 1
57 | 2 | place | house | 3 | 1 1.001
59 | osm_id | class | type | housenumber | geometry
60 | 1 | place | houses | all | 1 1, 1 1.001
65 Then way 1 expands to lines
66 | startnumber | endnumber | geometry
67 | 1 | 3 | 1 1, 1 1.001
69 Scenario: Even two point interpolation line with intermediate empty node
71 | osm_id | class | type | housenumber | geometry
72 | 1 | place | house | 2 | 1 1
73 | 2 | place | house | 10 | 1.001 1.001
75 | osm_id | class | type | housenumber | geometry
76 | 1 | place | houses | even | 1 1, 1 1.001, 1.001 1.001
81 Then way 1 expands to lines
82 | startnumber | endnumber | geometry
83 | 2 | 10 | 1 1, 1 1.001, 1.001 1.001
85 Scenario: Even two point interpolation line with intermediate duplicated empty node
87 | osm_id | class | type | housenumber | geometry
88 | 1 | place | house | 2 | 1 1
89 | 2 | place | house | 10 | 1.001 1.001
91 | osm_id | class | type | housenumber | geometry
92 | 1 | place | houses | even | 1 1, 1 1.001, 1.001 1.001
97 Then way 1 expands to lines
98 | startnumber | endnumber | geometry
99 | 2 | 10 | 1 1, 1 1.001, 1.001 1.001
101 Scenario: Simple even three point interpolation line
102 Given the place nodes
103 | osm_id | class | type | housenumber | geometry
104 | 1 | place | house | 2 | 1 1
105 | 2 | place | house | 14 | 1.001 1.001
106 | 3 | place | house | 10 | 1 1.001
108 | osm_id | class | type | housenumber | geometry
109 | 1 | place | houses | even | 1 1, 1 1.001, 1.001 1.001
114 Then way 1 expands to lines
115 | startnumber | endnumber | geometry
116 | 2 | 10 | 1 1, 1 1.001
117 | 10 | 14 | 1 1.001, 1.001 1.001
119 Scenario: Simple even four point interpolation line
120 Given the place nodes
121 | osm_id | class | type | housenumber | geometry
122 | 1 | place | house | 2 | 1 1
123 | 2 | place | house | 14 | 1.001 1.001
124 | 3 | place | house | 10 | 1 1.001
125 | 4 | place | house | 18 | 1.001 1.002
127 | osm_id | class | type | housenumber | geometry
128 | 1 | place | houses | even | 1 1, 1 1.001, 1.001 1.001, 1.001 1.002
133 Then way 1 expands to lines
134 | startnumber | endnumber | geometry
135 | 2 | 10 | 1 1, 1 1.001
136 | 10 | 14 | 1 1.001, 1.001 1.001
137 | 14 | 18 | 1.001 1.001, 1.001 1.002
139 Scenario: Reverse simple even three point interpolation line
140 Given the place nodes
141 | osm_id | class | type | housenumber | geometry
142 | 1 | place | house | 2 | 1 1
143 | 2 | place | house | 14 | 1.001 1.001
144 | 3 | place | house | 10 | 1 1.001
146 | osm_id | class | type | housenumber | geometry
147 | 1 | place | houses | even | 1.001 1.001, 1 1.001, 1 1
152 Then way 1 expands to lines
153 | startnumber | endnumber | geometry
154 | 2 | 10 | 1 1, 1 1.001
155 | 10 | 14 | 1 1.001, 1.001 1.001
157 Scenario: Even three point interpolation line with odd center point
158 Given the place nodes
159 | osm_id | class | type | housenumber | geometry
160 | 1 | place | house | 2 | 1 1
161 | 2 | place | house | 8 | 1.001 1.001
162 | 3 | place | house | 7 | 1 1.001
164 | osm_id | class | type | housenumber | geometry
165 | 1 | place | houses | even | 1 1, 1 1.001, 1.001 1.001
170 Then way 1 expands to lines
171 | startnumber | endnumber | geometry
172 | 2 | 7 | 1 1, 1 1.001
173 | 7 | 8 | 1 1.001, 1.001 1.001
175 Scenario: Interpolation line with self-intersecting way
176 Given the place nodes
177 | osm_id | class | type | housenumber | geometry
178 | 1 | place | house | 2 | 0 0
179 | 2 | place | house | 6 | 0 0.001
180 | 3 | place | house | 10 | 0 0.002
182 | osm_id | class | type | housenumber | geometry
183 | 1 | place | houses | even | 0 0, 0 0.001, 0 0.002, 0 0.001
188 Then way 1 expands to lines
189 | startnumber | endnumber | geometry
190 | 2 | 6 | 0 0, 0 0.001
191 | 6 | 10 | 0 0.001, 0 0.002
192 | 6 | 10 | 0 0.001, 0 0.002
194 Scenario: Interpolation line with self-intersecting way II
195 Given the place nodes
196 | osm_id | class | type | housenumber | geometry
197 | 1 | place | house | 2 | 0 0
198 | 2 | place | house | 6 | 0 0.001
200 | osm_id | class | type | housenumber | geometry
201 | 1 | place | houses | even | 0 0, 0 0.001, 0 0.002, 0 0.001
206 Then way 1 expands to lines
207 | startnumber | endnumber | geometry
208 | 2 | 6 | 0 0, 0 0.001
210 Scenario: addr:street on interpolation way
211 Given the scene parallel-road
213 | osm_id | class | type | housenumber | geometry
214 | 1 | place | house | 2 | :n-middle-w
215 | 2 | place | house | 6 | :n-middle-e
216 | 3 | place | house | 12 | :n-middle-w
217 | 4 | place | house | 16 | :n-middle-e
219 | osm_id | class | type | housenumber | street | geometry
220 | 10 | place | houses | even | | :w-middle
221 | 11 | place | houses | even | Cloud Street | :w-middle
223 | osm_id | class | type | name | geometry
224 | 2 | highway | tertiary | 'name' : 'Sun Way' | :w-north
225 | 3 | highway | tertiary | 'name' : 'Cloud Street' | :w-south
228 | 10 | 1,100,101,102,2
229 | 11 | 3,200,201,202,4
231 Then table placex contains
232 | object | parent_place_id
237 Then table location_property_osmline contains
238 | object | parent_place_id | startnumber | endnumber
241 When sending query "16 Cloud Street"
243 | ID | osm_type | osm_id
245 When sending query "14 Cloud Street"
247 | ID | osm_type | osm_id
249 When sending query "18 Cloud Street"
251 | ID | osm_type | osm_id
254 Scenario: addr:street on housenumber way
255 Given the scene parallel-road
257 | osm_id | class | type | housenumber | street | geometry
258 | 1 | place | house | 2 | | :n-middle-w
259 | 2 | place | house | 6 | | :n-middle-e
260 | 3 | place | house | 12 | Cloud Street | :n-middle-w
261 | 4 | place | house | 16 | Cloud Street | :n-middle-e
263 | osm_id | class | type | housenumber | geometry
264 | 10 | place | houses | even | :w-middle
265 | 11 | place | houses | even | :w-middle
267 | osm_id | class | type | name | geometry
268 | 2 | highway | tertiary | 'name' : 'Sun Way' | :w-north
269 | 3 | highway | tertiary | 'name' : 'Cloud Street' | :w-south
272 | 10 | 1,100,101,102,2
273 | 11 | 3,200,201,202,4
275 Then table placex contains
276 | object | parent_place_id
281 And table location_property_osmline contains
282 | object | parent_place_id | startnumber | endnumber
285 When sending query "16 Cloud Street"
287 | ID | osm_type | osm_id
289 When sending query "14 Cloud Street"
291 | ID | osm_type | osm_id
294 Scenario: Geometry of points and way don't match (github #253)
295 Given the place nodes
296 | osm_id | class | type | housenumber | geometry
297 | 1 | place | house | 10 | 144.9632341 -37.76163
298 | 2 | place | house | 6 | 144.9630541 -37.7628174
299 | 3 | shop | supermarket | 2 | 144.9629794 -37.7630755
301 | osm_id | class | type | housenumber | geometry
302 | 1 | place | houses | even | 144.9632341 -37.76163,144.9630541 -37.7628172,144.9629794 -37.7630755
307 Then way 1 expands to lines
308 | startnumber | endnumber | geometry
309 | 2 | 6 | 144.9629794 -37.7630755, 144.9630541 -37.7628174
310 | 6 | 10 | 144.9630541 -37.7628174, 144.9632341 -37.76163
312 Scenario: Place with missing address information
313 Given the place nodes
314 | osm_id | class | type | housenumber | geometry
315 | 1 | place | house | 23 | 0.0001 0.0001
316 | 2 | amenity | school | | 0.0001 0.0002
317 | 3 | place | house | 29 | 0.0001 0.0004
319 | osm_id | class | type | housenumber | geometry
320 | 1 | place | houses | odd | 0.0001 0.0001,0.0001 0.0002,0.0001 0.0004
325 Then way 1 expands to lines
326 | startnumber | endnumber | geometry
327 | 23 | 29 | 0.0001 0.0001, 0.0001 0.0002, 0.0001 0.0004