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
193 Scenario: Interpolation line with self-intersecting way II
194 Given the place nodes
195 | osm_id | class | type | housenumber | geometry
196 | 1 | place | house | 2 | 0 0
197 | 2 | place | house | 6 | 0 0.001
199 | osm_id | class | type | housenumber | geometry
200 | 1 | place | houses | even | 0 0, 0 0.001, 0 0.002, 0 0.001
205 Then way 1 expands to lines
206 | startnumber | endnumber | geometry
207 | 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
242 Scenario: addr:street on housenumber way
243 Given the scene parallel-road
245 | osm_id | class | type | housenumber | street | geometry
246 | 1 | place | house | 2 | | :n-middle-w
247 | 2 | place | house | 6 | | :n-middle-e
248 | 3 | place | house | 12 | Cloud Street | :n-middle-w
249 | 4 | place | house | 16 | Cloud Street | :n-middle-e
251 | osm_id | class | type | housenumber | geometry
252 | 10 | place | houses | even | :w-middle
253 | 11 | place | houses | even | :w-middle
255 | osm_id | class | type | name | geometry
256 | 2 | highway | tertiary | 'name' : 'Sun Way' | :w-north
257 | 3 | highway | tertiary | 'name' : 'Cloud Street' | :w-south
260 | 10 | 1,100,101,102,2
261 | 11 | 3,200,201,202,4
263 Then table placex contains
264 | object | parent_place_id
269 And table location_property_osmline contains
270 | object | parent_place_id | startnumber | endnumber
274 Scenario: Geometry of points and way don't match (github #253)
275 Given the place nodes
276 | osm_id | class | type | housenumber | geometry
277 | 1 | place | house | 10 | 144.9632341 -37.76163
278 | 2 | place | house | 6 | 144.9630541 -37.7628174
279 | 3 | shop | supermarket | 2 | 144.9629794 -37.7630755
281 | osm_id | class | type | housenumber | geometry
282 | 1 | place | houses | even | 144.9632341 -37.76163,144.9630541 -37.7628172,144.9629794 -37.7630755
287 Then way 1 expands to lines
288 | startnumber | endnumber | geometry
289 | 2 | 6 | 144.9629794 -37.7630755, 144.9630541 -37.7628174
290 | 6 | 10 | 144.9630541 -37.7628174, 144.9632341 -37.76163
292 Scenario: Place with missing address information
293 Given the place nodes
294 | osm_id | class | type | housenumber | geometry
295 | 1 | place | house | 23 | 0.0001 0.0001
296 | 2 | amenity | school | | 0.0001 0.0002
297 | 3 | place | house | 29 | 0.0001 0.0004
299 | osm_id | class | type | housenumber | geometry
300 | 1 | place | houses | odd | 0.0001 0.0001,0.0001 0.0002,0.0001 0.0004
305 Then way 1 expands to lines
306 | startnumber | endnumber | geometry
307 | 23 | 29 | 0.0001 0.0001, 0.0001 0.0002, 0.0001 0.0004