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"
30 | osm_type | osm_id | name |
31 | N | 1 | 23, Rose Street |
33 Scenario: Searching for unknown addr: tags also works for multiple words
34 Given the scene roads-with-pois
36 | osm | class | type | housenr | addr+city | geometry |
37 | N1 | place | house | 23 | Little Big Town | :p-N1 |
39 | osm | class | type | name+name | geometry |
40 | W1 | highway | residential | Rose Street | :w-north |
42 Then search_name contains
43 | object | name_vector | nameaddress_vector |
44 | N1 | #23 | Rose Street, Little, Big, Town |
45 When searching for "23 Rose Street, Little Big Town"
47 | osm_type | osm_id | name |
48 | N | 1 | 23, Rose Street |
50 Scenario: Unnamed POI has no search entry when it has known addr: tags
51 Given the scene roads-with-pois
53 | osm | class | type | housenr | addr+city | geometry |
54 | N1 | place | house | 23 | Walltown | :p-N1 |
56 | osm | class | type | name+name | addr+city | geometry |
57 | W1 | highway | residential | Rose Street | Walltown | :w-north |
59 Then search_name has no entry for N1
60 When searching for "23 Rose Street, Walltown"
62 | osm_type | osm_id | name |
63 | N | 1 | 23, Rose Street |
65 Scenario: Unnamed POI must have a house number to get a search entry
66 Given the scene roads-with-pois
68 | osm | class | type | addr+city | geometry |
69 | N1 | place | house | Walltown | :p-N1 |
71 | osm | class | type | name+name | geometry |
72 | W1 | highway | residential | Rose Street | :w-north |
74 Then search_name has no entry for N1
76 Scenario: Unnamed POIs inherit parent name when unknown addr:place is present
77 Given the scene roads-with-pois
79 | osm | class | type | housenr | addr+place | geometry |
80 | N1 | place | house | 23 | Walltown | :p-N1 |
82 | osm | class | type | name+name | geometry |
83 | W1 | highway | residential | Rose Street | :w-north |
84 | N2 | place | city | Strange Town | :p-N1 |
87 | object | parent_place_id |
89 Then search_name contains
90 | object | name_vector | nameaddress_vector |
91 | N1 | #23 | Walltown, Strange, Town |
92 When searching for "23 Rose Street"
93 Then exactly 1 results are returned
95 | osm_type | osm_id | name |
96 | W | 1 | Rose Street, Strange Town |
97 When searching for "23 Walltown, Strange Town"
99 | osm_type | osm_id | name |
100 | N | 1 | 23, Walltown, Strange Town |
102 Scenario: Unnamed POIs doesn't inherit parent name when addr:place is present only in parent address
103 Given the scene roads-with-pois
105 | osm | class | type | housenr | addr+place | geometry |
106 | N1 | place | house | 23 | Walltown | :p-N1 |
108 | osm | class | type | name+name | addr+city | geometry |
109 | W1 | highway | residential | Rose Street | Walltown | :w-north |
110 | N2 | place | suburb | Strange Town | Walltown | :p-N1 |
112 Then search_name contains
113 | object | name_vector | nameaddress_vector |
114 | N1 | #23 | Walltown |
115 When searching for "23 Rose Street, Walltown"
116 Then exactly 1 result is returned
118 | osm_type | osm_id | name |
119 | W | 1 | Rose Street, Strange Town |
120 When searching for "23 Walltown"
121 Then exactly 1 result is returned
123 | osm_type | osm_id | name |
124 | N | 1 | 23, Walltown, Strange Town |
126 Scenario: Unnamed POIs does inherit parent name when unknown addr:place and addr:street is present
127 Given the scene roads-with-pois
129 | osm | class | type | housenr | addr+place | addr+street | geometry |
130 | N1 | place | house | 23 | Walltown | Lily Street | :p-N1 |
132 | osm | class | type | name+name | geometry |
133 | W1 | highway | residential | Rose Street | :w-north |
135 Then search_name has no entry for N1
136 When searching for "23 Rose Street"
138 | osm_type | osm_id | name |
139 | N | 1 | 23, Rose Street |
140 When searching for "23 Lily Street"
141 Then exactly 0 results are returned
143 Scenario: An unknown addr:street is ignored
144 Given the scene roads-with-pois
146 | osm | class | type | housenr | addr+street | geometry |
147 | N1 | place | house | 23 | Lily Street | :p-N1 |
149 | osm | class | type | name+name | geometry |
150 | W1 | highway | residential | Rose Street | :w-north |
152 Then search_name has no entry for N1
153 When searching for "23 Rose Street"
155 | osm_type | osm_id | name |
156 | N | 1 | 23, Rose Street |
157 When searching for "23 Lily Street"
158 Then exactly 0 results are returned
160 Scenario: Named POIs have unknown address tags added in the search_name table
161 Given the scene roads-with-pois
163 | osm | class | type | name+name | addr+city | geometry |
164 | N1 | place | house | Green Moss | Walltown | :p-N1 |
166 | osm | class | type | name+name | geometry |
167 | W1 | highway | residential | Rose Street | :w-north |
169 Then search_name contains
170 | object | name_vector | nameaddress_vector |
171 | N1 | #Green Moss | Rose Street, Walltown |
172 When searching for "Green Moss, Rose Street, Walltown"
174 | osm_type | osm_id | name |
175 | N | 1 | Green Moss, Rose Street |
177 Scenario: Named POI doesn't inherit parent name when addr:place is present only in parent address
178 Given the scene roads-with-pois
180 | osm | class | type | name+name | addr+place | geometry |
181 | N1 | place | house | Green Moss | Walltown | :p-N1 |
183 | osm | class | type | name+name | geometry |
184 | W1 | highway | residential | Rose Street | :w-north |
185 | N2 | place | suburb | Strange Town | :p-N1 |
187 Then search_name contains
188 | object | name_vector | nameaddress_vector |
189 | N1 | #Green Moss | Walltown |
190 When searching for "Green Moss, Rose Street, Walltown"
191 Then exactly 0 result is returned
192 When searching for "Green Moss, Walltown"
194 | osm_type | osm_id | name |
195 | N | 1 | Green Moss, Walltown, Strange Town |
197 Scenario: Named POIs inherit address from parent
198 Given the scene roads-with-pois
200 | osm | class | type | name | geometry |
201 | N1 | place | house | foo | :p-N1 |
202 | W1 | highway | residential | the road | :w-north |
204 Then search_name contains
205 | object | name_vector | nameaddress_vector |
206 | N1 | foo | the road |
208 Scenario: Some addr: tags are added to address
209 Given the scene roads-with-pois
211 | osm | class | type | name | geometry |
212 | N2 | place | city | bonn | 81 81 |
213 | N3 | place | suburb | smalltown| 80 81 |
215 | osm | class | type | addr+city | addr+municipality | addr+suburb | geometry |
216 | W1 | highway | service | bonn | New York | Smalltown | :w-north |
218 Then search_name contains
219 | object | nameaddress_vector |
220 | W1 | bonn, new, york, smalltown |
222 Scenario: A known addr:* tag is added even if the name is unknown
223 Given the scene roads-with-pois
225 | osm | class | type | name | addr+city | geometry |
226 | W1 | highway | residential | Road | Nandu | :w-north |
228 Then search_name contains
229 | object | nameaddress_vector |
232 Scenario: addr:postcode is not added to the address terms
233 Given the scene roads-with-pois
235 | osm | class | type | name+ref | geometry |
236 | N1 | place | state | 12345 | 80 80 |
238 | osm | class | type | addr+postcode | geometry |
239 | W1 | highway | residential | 12345 | :w-north |
241 Then search_name contains not
242 | object | nameaddress_vector |
245 Scenario: a linked place does not show up in search name
246 Given the named places
247 | osm | class | type | admin | geometry |
248 | R13 | boundary | administrative | 9 | poly-area:0.01 |
250 | osm | class | type | geometry |
251 | N2 | place | city | 0.1 0.1 |
253 | id | members | tags+type |
254 | 13 | N2:label | boundary |
257 | object | linked_place_id |
259 And search_name has no entry for N2
261 Scenario: a linked waterway does not show up in search name
262 Given the scene split-road
264 | osm | class | type | name | geometry |
265 | W1 | waterway | river | Rhein | :w-2 |
266 | W2 | waterway | river | Rhein | :w-3 |
267 | R13 | waterway | river | Rhein | :w-1 + :w-2 + :w-3 |
269 | id | members | tags+type |
270 | 13 | W1,W2:main_stream | waterway |
273 | object | linked_place_id |
276 And search_name has no entry for W1
277 And search_name has no entry for W2