2 Feature: Creation of search terms
3 Tests that search_name table is filled correctly
5 Scenario: Unnamed POIs have no search entry
6 Given the scene roads-with-pois
8 | osm | class | type | geometry |
9 | N1 | place | house | :p-N1 |
11 | osm | class | type | geometry |
12 | W1 | highway | residential | :w-north |
14 Then search_name has no entry for N1
16 Scenario: Unnamed POI has a search entry when it has unknown addr: tags
17 Given the scene roads-with-pois
19 | osm | class | type | housenr | addr+city | geometry |
20 | N1 | place | house | 23 | Walltown | :p-N1 |
22 | osm | class | type | name+name | geometry |
23 | W1 | highway | residential | Rose Street | :w-north |
25 Then search_name contains
26 | object | name_vector | nameaddress_vector |
27 | N1 | #23 | Rose Street, Walltown |
28 When searching for "23 Rose Street, Walltown"
33 Scenario: Unnamed POI has no search entry when it has known addr: tags
34 Given the scene roads-with-pois
36 | osm | class | type | housenr | addr+city | geometry |
37 | N1 | place | house | 23 | Walltown | :p-N1 |
39 | osm | class | type | name+name | addr+city | geometry |
40 | W1 | highway | residential | Rose Street | Walltown | :w-north |
42 Then search_name has no entry for N1
43 When searching for "23 Rose Street, Walltown"
48 Scenario: Unnamed POI must have a house number to get a search entry
49 Given the scene roads-with-pois
51 | osm | class | type | addr+city | geometry |
52 | N1 | place | house | Walltown | :p-N1 |
54 | osm | class | type | name+name | geometry |
55 | W1 | highway | residential | Rose Street | :w-north |
57 Then search_name has no entry for N1
59 Scenario: Unnamed POIs doesn't inherit parent name when unknown addr:place is present
60 Given the scene roads-with-pois
62 | osm | class | type | housenr | addr+place | geometry |
63 | N1 | place | house | 23 | Walltown | :p-N1 |
65 | osm | class | type | name+name | geometry |
66 | W1 | highway | residential | Rose Street | :w-north |
67 | N2 | place | city | Strange Town | :p-N1 |
69 Then search_name contains
70 | object | name_vector | nameaddress_vector |
71 | N1 | #23 | Walltown |
72 When searching for "23 Rose Street"
73 Then exactly 1 results are returned
77 When searching for "23 Walltown"
82 Scenario: Unnamed POIs doesn't inherit parent name when addr:place is present only in parent address
83 Given the scene roads-with-pois
85 | osm | class | type | housenr | addr+place | geometry |
86 | N1 | place | house | 23 | Walltown | :p-N1 |
88 | osm | class | type | name+name | addr+city | geometry |
89 | W1 | highway | residential | Rose Street | Walltown | :w-north |
90 | N2 | place | suburb | Strange Town | Walltown | :p-N1 |
92 Then search_name contains
93 | object | name_vector | nameaddress_vector |
94 | N1 | #23 | Walltown |
95 When searching for "23 Rose Street, Walltown"
96 Then exactly 1 result is returned
100 When searching for "23 Walltown"
101 Then exactly 1 result is returned
103 | osm_type | osm_id |
106 Scenario: Unnamed POIs does inherit parent name when unknown addr:place and addr:street is present
107 Given the scene roads-with-pois
109 | osm | class | type | housenr | addr+place | addr+street | geometry |
110 | N1 | place | house | 23 | Walltown | Lily Street | :p-N1 |
112 | osm | class | type | name+name | geometry |
113 | W1 | highway | residential | Rose Street | :w-north |
115 Then search_name has no entry for N1
116 When searching for "23 Rose Street"
118 | osm_type | osm_id |
120 When searching for "23 Lily Street"
121 Then exactly 0 results are returned
123 Scenario: An unknown addr:street is ignored
124 Given the scene roads-with-pois
126 | osm | class | type | housenr | addr+street | geometry |
127 | N1 | place | house | 23 | Lily Street | :p-N1 |
129 | osm | class | type | name+name | geometry |
130 | W1 | highway | residential | Rose Street | :w-north |
132 Then search_name has no entry for N1
133 When searching for "23 Rose Street"
135 | osm_type | osm_id |
137 When searching for "23 Lily Street"
138 Then exactly 0 results are returned
140 Scenario: Named POIs have unknown address tags added in the search_name table
141 Given the scene roads-with-pois
143 | osm | class | type | name+name | addr+city | geometry |
144 | N1 | place | house | Green Moss | Walltown | :p-N1 |
146 | osm | class | type | name+name | geometry |
147 | W1 | highway | residential | Rose Street | :w-north |
149 Then search_name contains
150 | object | name_vector | nameaddress_vector |
151 | N1 | #Green Moss | Rose Street, Walltown |
152 When searching for "Green Moss, Rose Street, Walltown"
154 | osm_type | osm_id |
157 Scenario: Named POI doesn't inherit parent name when addr:place is present only in parent address
158 Given the scene roads-with-pois
160 | osm | class | type | name+name | addr+place | geometry |
161 | N1 | place | house | Green Moss | Walltown | :p-N1 |
163 | osm | class | type | name+name | geometry |
164 | W1 | highway | residential | Rose Street | :w-north |
165 | N2 | place | suburb | Strange Town | :p-N1 |
167 Then search_name contains
168 | object | name_vector | nameaddress_vector |
169 | N1 | #Green Moss | Walltown |
170 When searching for "Green Moss, Rose Street, Walltown"
171 Then exactly 0 result is returned
172 When searching for "Green Moss, Walltown"
174 | osm_type | osm_id |
177 Scenario: Named POIs inherit address from parent
178 Given the scene roads-with-pois
180 | osm | class | type | name | geometry |
181 | N1 | place | house | foo | :p-N1 |
182 | W1 | highway | residential | the road | :w-north |
184 Then search_name contains
185 | object | name_vector | nameaddress_vector |
186 | N1 | foo | the road |
188 Scenario: Some addr: tags are added to address when the name exists
189 Given the scene roads-with-pois
191 | osm | class | type | name | geometry |
192 | N1 | place | state | new york | 80 80 |
193 | N2 | place | city | bonn | 81 81 |
194 | N3 | place | suburb | smalltown| 80 81 |
196 | osm | class | type | addr+city | addr+state | addr+suburb | geometry |
197 | W1 | highway | service | bonn | New York | Smalltown | :w-north |
199 Then search_name contains
200 | object | nameaddress_vector |
201 | W1 | bonn, new york, smalltown |
203 Scenario: A known addr:* tag is added even if the name is unknown
204 Given the scene roads-with-pois
206 | osm | class | type | name | addr+city | geometry |
207 | W1 | highway | residential | Road | Nandu | :w-north |
209 Then search_name contains
210 | object | nameaddress_vector |
213 Scenario: addr:postcode is not added to the address terms
214 Given the scene roads-with-pois
216 | osm | class | type | name+ref | geometry |
217 | N1 | place | state | 12345 | 80 80 |
219 | osm | class | type | addr+postcode | geometry |
220 | W1 | highway | residential | 12345 | :w-north |
222 Then search_name contains not
223 | object | nameaddress_vector |
226 Scenario: is_in is split and added to the address search terms
227 Given the scene roads-with-pois
229 | osm | class | type | name | geometry |
230 | N1 | place | state | new york | 80 80 |
231 | N2 | place | city | bonn | 81 81 |
232 | N3 | place | suburb | smalltown| 80 81 |
234 | osm | class | type | addr+is_in | geometry |
235 | W1 | highway | service | bonn, New York, Smalltown | :w-north |
237 Then search_name contains
238 | object | nameaddress_vector |
239 | W1 | bonn, new york, smalltown |
241 Scenario: a linked place does not show up in search name
242 Given the named places
243 | osm | class | type | admin | geometry |
244 | R13 | boundary | administrative | 9 | poly-area:0.01 |
246 | osm | class | type | geometry |
247 | N2 | place | city | 0.1 0.1 |
249 | id | members | tags+type |
250 | 13 | N2:label | boundary |
253 | object | linked_place_id |
255 And search_name has no entry for N2
257 Scenario: a linked waterway does not show up in search name
258 Given the scene split-road
260 | osm | class | type | name | geometry |
261 | W1 | waterway | river | Rhein | :w-2 |
262 | W2 | waterway | river | Rhein | :w-3 |
263 | R13 | waterway | river | Rhein | :w-1 + :w-2 + :w-3 |
265 | id | members | tags+type |
266 | 13 | W1,W2:main_stream | waterway |
269 | object | linked_place_id |
272 And search_name has no entry for W1
273 And search_name has no entry for W2