2 Feature: Creation of search terms
3 Tests that search_name table is filled correctly
5 Scenario Outline: Comma- and semicolon separated names appear as full names
7 | osm | class | type | name+alt_name |
8 | N1 | place | city | New York<sep>Big Apple |
10 Then search_name contains
11 | object | name_vector |
12 | N1 | #New York, #Big Apple |
19 Scenario Outline: Name parts before brackets appear as full names
21 | osm | class | type | name+name |
22 | N1 | place | city | Halle (Saale) |
24 Then search_name contains
25 | object | name_vector |
26 | N1 | #Halle Saale, #Halle |
28 Scenario: Unnamed POIs have no search entry
29 Given the scene roads-with-pois
31 | osm | class | type | geometry |
32 | N1 | place | house | :p-N1 |
34 | osm | class | type | geometry |
35 | W1 | highway | residential | :w-north |
37 Then search_name has no entry for N1
39 Scenario: Unnamed POI has a search entry when it has unknown addr: tags
40 Given the scene roads-with-pois
42 | osm | class | type | housenr | addr+city | geometry |
43 | N1 | place | house | 23 | Walltown | :p-N1 |
45 | osm | class | type | name+name | geometry |
46 | W1 | highway | residential | Rose Street | :w-north |
48 Then search_name contains
49 | object | nameaddress_vector |
50 | N1 | #Rose Street, Walltown |
51 When searching for "23 Rose Street, Walltown"
53 | osm_type | osm_id | name |
54 | N | 1 | 23, Rose Street |
55 When searching for "Walltown, Rose Street 23"
57 | osm_type | osm_id | name |
58 | N | 1 | 23, Rose Street |
59 When searching for "Rose Street 23, Walltown"
61 | osm_type | osm_id | name |
62 | N | 1 | 23, Rose Street |
64 Scenario: Searching for unknown addr: tags also works for multiple words
65 Given the scene roads-with-pois
67 | osm | class | type | housenr | addr+city | geometry |
68 | N1 | place | house | 23 | Little Big Town | :p-N1 |
70 | osm | class | type | name+name | geometry |
71 | W1 | highway | residential | Rose Street | :w-north |
73 Then search_name contains
74 | object | nameaddress_vector |
75 | N1 | #Rose Street, rose, Little, Big, Town |
76 When searching for "23 Rose Street, Little Big Town"
78 | osm_type | osm_id | name |
79 | N | 1 | 23, Rose Street |
80 When searching for "Rose Street 23, Little Big Town"
82 | osm_type | osm_id | name |
83 | N | 1 | 23, Rose Street |
84 When searching for "Little big Town, Rose Street 23"
86 | osm_type | osm_id | name |
87 | N | 1 | 23, Rose Street |
89 Scenario: Unnamed POI has no search entry when it has known addr: tags
90 Given the scene roads-with-pois
92 | osm | class | type | housenr | addr+city | geometry |
93 | N1 | place | house | 23 | Walltown | :p-N1 |
95 | osm | class | type | name+name | addr+city | geometry |
96 | W1 | highway | residential | Rose Street | Walltown | :w-north |
98 Then search_name has no entry for N1
99 When searching for "23 Rose Street, Walltown"
101 | osm_type | osm_id | name |
102 | N | 1 | 23, Rose Street |
104 Scenario: Unnamed POI must have a house number to get a search entry
105 Given the scene roads-with-pois
107 | osm | class | type | addr+city | geometry |
108 | N1 | place | house | Walltown | :p-N1 |
110 | osm | class | type | name+name | geometry |
111 | W1 | highway | residential | Rose Street | :w-north |
113 Then search_name has no entry for N1
115 Scenario: Unnamed POIs inherit parent name when unknown addr:place is present
116 Given the scene roads-with-pois
118 | osm | class | type | housenr | addr+place | geometry |
119 | N1 | place | house | 23 | Walltown | :p-N1 |
121 | osm | class | type | name+name | geometry |
122 | W1 | highway | residential | Rose Street | :w-north |
123 | N2 | place | city | Strange Town | :p-N1 |
126 | object | parent_place_id |
128 Then search_name contains
129 | object | name_vector | nameaddress_vector |
130 | N1 | #Walltown | Strange, Town |
131 When searching for "23 Rose Street"
132 Then exactly 1 results are returned
134 | osm_type | osm_id | name |
135 | W | 1 | Rose Street, Strange Town |
136 When searching for "23 Walltown, Strange Town"
138 | osm_type | osm_id | name |
139 | N | 1 | 23, Walltown, Strange Town |
140 When searching for "Walltown 23, Strange Town"
142 | osm_type | osm_id | name |
143 | N | 1 | 23, Walltown, Strange Town |
144 When searching for "Strange Town, Walltown 23"
146 | osm_type | osm_id | name |
147 | N | 1 | 23, Walltown, Strange Town |
149 Scenario: Named POIs can be searched by housenumber when unknown addr:place is present
150 Given the scene roads-with-pois
152 | osm | class | type | name | housenr | addr+place | geometry |
153 | N1 | place | house | Blue house | 23 | Walltown | :p-N1 |
155 | osm | class | type | name+name | geometry |
156 | W1 | highway | residential | Rose Street | :w-north |
157 | N2 | place | city | Strange Town | :p-N1 |
159 Then search_name contains
160 | object | name_vector | nameaddress_vector |
161 | N1 | #Walltown, #Blue house | Walltown, Strange, Town |
162 When searching for "23 Walltown, Strange Town"
164 | osm_type | osm_id | name |
165 | N | 1 | Blue house, 23, Walltown, Strange Town |
166 When searching for "Walltown 23, Strange Town"
168 | osm_type | osm_id | name |
169 | N | 1 | Blue house, 23, Walltown, Strange Town |
170 When searching for "Strange Town, Walltown 23"
172 | osm_type | osm_id | name |
173 | N | 1 | Blue house, 23, Walltown, Strange Town |
174 When searching for "Strange Town, Walltown 23, Blue house"
176 | osm_type | osm_id | name |
177 | N | 1 | Blue house, 23, Walltown, Strange Town |
178 When searching for "Strange Town, Walltown, Blue house"
180 | osm_type | osm_id | name |
181 | N | 1 | Blue house, 23, Walltown, Strange Town |
183 Scenario: Named POIs can be found when unknown multi-word addr:place is present
184 Given the scene roads-with-pois
186 | osm | class | type | name | housenr | addr+place | geometry |
187 | N1 | place | house | Blue house | 23 | Moon sun | :p-N1 |
189 | osm | class | type | name+name | geometry |
190 | W1 | highway | residential | Rose Street | :w-north |
191 | N2 | place | city | Strange Town | :p-N1 |
193 Then search_name contains
194 | object | name_vector | nameaddress_vector |
195 | N1 | #Moon sun, #Blue house | Moon, Sun, Strange, Town |
196 When searching for "23 Moon Sun, Strange Town"
198 | osm_type | osm_id | name |
199 | N | 1 | Blue house, 23, Moon sun, Strange Town |
200 When searching for "Blue house, Moon Sun, Strange Town"
202 | osm_type | osm_id | name |
203 | N | 1 | Blue house, 23, Moon sun, Strange Town |
205 Scenario: Unnamed POIs doesn't inherit parent name when addr:place is present only in parent address
206 Given the scene roads-with-pois
208 | osm | class | type | housenr | addr+place | geometry |
209 | N1 | place | house | 23 | Walltown | :p-N1 |
211 | osm | class | type | name+name | addr+city | geometry |
212 | W1 | highway | residential | Rose Street | Walltown | :w-north |
213 | N2 | place | suburb | Strange Town | Walltown | :p-N1 |
215 Then search_name contains
216 | object | name_vector | nameaddress_vector |
217 | N1 | #Walltown | Strange, Town |
218 When searching for "23 Rose Street, Walltown"
219 Then exactly 1 result is returned
221 | osm_type | osm_id | name |
222 | W | 1 | Rose Street, Strange Town |
223 When searching for "23 Walltown"
224 Then exactly 1 result is returned
226 | osm_type | osm_id | name |
227 | N | 1 | 23, Walltown, Strange Town |
229 Scenario: Unnamed POIs does inherit parent name when unknown addr:place and addr:street is present
230 Given the scene roads-with-pois
232 | osm | class | type | housenr | addr+place | addr+street | geometry |
233 | N1 | place | house | 23 | Walltown | Lily Street | :p-N1 |
235 | osm | class | type | name+name | geometry |
236 | W1 | highway | residential | Rose Street | :w-north |
238 Then search_name has no entry for N1
239 When searching for "23 Rose Street"
241 | osm_type | osm_id | name |
242 | N | 1 | 23, Rose Street |
243 When searching for "23 Lily Street"
244 Then exactly 0 results are returned
246 Scenario: An unknown addr:street is ignored
247 Given the scene roads-with-pois
249 | osm | class | type | housenr | addr+street | geometry |
250 | N1 | place | house | 23 | Lily Street | :p-N1 |
252 | osm | class | type | name+name | geometry |
253 | W1 | highway | residential | Rose Street | :w-north |
255 Then search_name has no entry for N1
256 When searching for "23 Rose Street"
258 | osm_type | osm_id | name |
259 | N | 1 | 23, Rose Street |
260 When searching for "23 Lily Street"
261 Then exactly 0 results are returned
263 Scenario: Named POIs get unknown address tags added in the search_name table
264 Given the scene roads-with-pois
266 | osm | class | type | name+name | housenr | addr+city | geometry |
267 | N1 | place | house | Green Moss | 26 | Walltown | :p-N1 |
269 | osm | class | type | name+name | geometry |
270 | W1 | highway | residential | Rose Street | :w-north |
272 Then search_name contains
273 | object | name_vector | nameaddress_vector |
274 | N1 | #Green Moss | #Rose Street, Walltown |
275 When searching for "Green Moss, Rose Street, Walltown"
277 | osm_type | osm_id | name |
278 | N | 1 | Green Moss, 26, Rose Street |
279 When searching for "Green Moss, 26, Rose Street, Walltown"
281 | osm_type | osm_id | name |
282 | N | 1 | Green Moss, 26, Rose Street |
283 When searching for "26, Rose Street, Walltown"
285 | osm_type | osm_id | name |
286 | N | 1 | Green Moss, 26, Rose Street |
287 When searching for "Rose Street 26, Walltown"
289 | osm_type | osm_id | name |
290 | N | 1 | Green Moss, 26, Rose Street |
291 When searching for "Walltown, Rose Street 26"
293 | osm_type | osm_id | name |
294 | N | 1 | Green Moss, 26, Rose Street |
296 Scenario: Named POI doesn't inherit parent name when addr:place is present only in parent address
297 Given the scene roads-with-pois
299 | osm | class | type | name+name | addr+place | geometry |
300 | N1 | place | house | Green Moss | Walltown | :p-N1 |
302 | osm | class | type | name+name | geometry |
303 | W1 | highway | residential | Rose Street | :w-north |
304 | N2 | place | suburb | Strange Town | :p-N1 |
306 Then search_name contains
307 | object | name_vector | nameaddress_vector |
308 | N1 | #Green Moss | Walltown |
309 When searching for "Green Moss, Rose Street, Walltown"
310 Then exactly 0 result is returned
311 When searching for "Green Moss, Walltown"
313 | osm_type | osm_id | name |
314 | N | 1 | Green Moss, Walltown, Strange Town |
316 Scenario: Named POIs inherit address from parent
317 Given the scene roads-with-pois
319 | osm | class | type | name | geometry |
320 | N1 | place | house | foo | :p-N1 |
321 | W1 | highway | residential | the road | :w-north |
323 Then search_name contains
324 | object | name_vector | nameaddress_vector |
325 | N1 | foo | #the road |
327 Scenario: Some addr: tags are added to address
328 Given the scene roads-with-pois
330 | osm | class | type | name | geometry |
331 | N2 | place | city | bonn | 81 81 |
332 | N3 | place | suburb | smalltown| 80 81 |
334 | osm | class | type | addr+city | addr+municipality | addr+suburb | geometry |
335 | W1 | highway | service | bonn | New York | Smalltown | :w-north |
337 Then search_name contains
338 | object | nameaddress_vector |
339 | W1 | bonn, new, york, smalltown |
341 Scenario: A known addr:* tag is added even if the name is unknown
342 Given the scene roads-with-pois
344 | osm | class | type | name | addr+city | geometry |
345 | W1 | highway | residential | Road | Nandu | :w-north |
347 Then search_name contains
348 | object | nameaddress_vector |
351 Scenario: addr:postcode is not added to the address terms
352 Given the scene roads-with-pois
354 | osm | class | type | name+ref | geometry |
355 | N1 | place | state | 12345 | 80 80 |
357 | osm | class | type | addr+postcode | geometry |
358 | W1 | highway | residential | 12345 | :w-north |
360 Then search_name contains not
361 | object | nameaddress_vector |
364 Scenario: a linked place does not show up in search name
365 Given the named places
366 | osm | class | type | admin | geometry |
367 | R13 | boundary | administrative | 9 | poly-area:0.01 |
369 | osm | class | type | geometry |
370 | N2 | place | city | 0.1 0.1 |
372 | id | members | tags+type |
373 | 13 | N2:label | boundary |
376 | object | linked_place_id |
378 And search_name has no entry for N2
380 Scenario: a linked waterway does not show up in search name
381 Given the scene split-road
383 | osm | class | type | name | geometry |
384 | W1 | waterway | river | Rhein | :w-2 |
385 | W2 | waterway | river | Rhein | :w-3 |
386 | R13 | waterway | river | Rhein | :w-1 + :w-2 + :w-3 |
388 | id | members | tags+type |
389 | 13 | W1,W2:main_stream | waterway |
392 | object | linked_place_id |
395 And search_name has no entry for W1
396 And search_name has no entry for W2