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: 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"
45 | osm_type | osm_id | name |
46 | N | 1 | 23, Rose Street |
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 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 |
70 | object | parent_place_id |
72 Then search_name contains
73 | object | name_vector | nameaddress_vector |
74 | N1 | #23 | Walltown, Strange, Town |
75 When searching for "23 Rose Street"
76 Then exactly 1 results are returned
78 | osm_type | osm_id | name |
79 | W | 1 | Rose Street, Strange Town |
80 When searching for "23 Walltown, Strange Town"
82 | osm_type | osm_id | name |
83 | N | 1 | 23, Walltown, Strange Town |
85 Scenario: Unnamed POIs doesn't inherit parent name when addr:place is present only in parent address
86 Given the scene roads-with-pois
88 | osm | class | type | housenr | addr+place | geometry |
89 | N1 | place | house | 23 | Walltown | :p-N1 |
91 | osm | class | type | name+name | addr+city | geometry |
92 | W1 | highway | residential | Rose Street | Walltown | :w-north |
93 | N2 | place | suburb | Strange Town | Walltown | :p-N1 |
95 Then search_name contains
96 | object | name_vector | nameaddress_vector |
97 | N1 | #23 | Walltown |
98 When searching for "23 Rose Street, Walltown"
99 Then exactly 1 result is returned
101 | osm_type | osm_id | name |
102 | W | 1 | Rose Street, Strange Town |
103 When searching for "23 Walltown"
104 Then exactly 1 result is returned
106 | osm_type | osm_id | name |
107 | N | 1 | 23, Walltown, Strange Town |
109 Scenario: Unnamed POIs does inherit parent name when unknown addr:place and addr:street is present
110 Given the scene roads-with-pois
112 | osm | class | type | housenr | addr+place | addr+street | geometry |
113 | N1 | place | house | 23 | Walltown | Lily Street | :p-N1 |
115 | osm | class | type | name+name | geometry |
116 | W1 | highway | residential | Rose Street | :w-north |
118 Then search_name has no entry for N1
119 When searching for "23 Rose Street"
121 | osm_type | osm_id | name |
122 | N | 1 | 23, Rose Street |
123 When searching for "23 Lily Street"
124 Then exactly 0 results are returned
126 Scenario: An unknown addr:street is ignored
127 Given the scene roads-with-pois
129 | osm | class | type | housenr | addr+street | geometry |
130 | N1 | place | house | 23 | 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: Named POIs have unknown address tags added in the search_name table
144 Given the scene roads-with-pois
146 | osm | class | type | name+name | addr+city | geometry |
147 | N1 | place | house | Green Moss | Walltown | :p-N1 |
149 | osm | class | type | name+name | geometry |
150 | W1 | highway | residential | Rose Street | :w-north |
152 Then search_name contains
153 | object | name_vector | nameaddress_vector |
154 | N1 | #Green Moss | Rose Street, Walltown |
155 When searching for "Green Moss, Rose Street, Walltown"
157 | osm_type | osm_id | name |
158 | N | 1 | Green Moss, Rose Street |
160 Scenario: Named POI doesn't inherit parent name when addr:place is present only in parent address
161 Given the scene roads-with-pois
163 | osm | class | type | name+name | addr+place | 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 |
168 | N2 | place | suburb | Strange Town | :p-N1 |
170 Then search_name contains
171 | object | name_vector | nameaddress_vector |
172 | N1 | #Green Moss | Walltown |
173 When searching for "Green Moss, Rose Street, Walltown"
174 Then exactly 0 result is returned
175 When searching for "Green Moss, Walltown"
177 | osm_type | osm_id | name |
178 | N | 1 | Green Moss, Walltown, Strange Town |
180 Scenario: Named POIs inherit address from parent
181 Given the scene roads-with-pois
183 | osm | class | type | name | geometry |
184 | N1 | place | house | foo | :p-N1 |
185 | W1 | highway | residential | the road | :w-north |
187 Then search_name contains
188 | object | name_vector | nameaddress_vector |
189 | N1 | foo | the road |
191 Scenario: Some addr: tags are added to address
192 Given the scene roads-with-pois
194 | osm | class | type | name | geometry |
195 | N2 | place | city | bonn | 81 81 |
196 | N3 | place | suburb | smalltown| 80 81 |
198 | osm | class | type | addr+city | addr+municipality | addr+suburb | geometry |
199 | W1 | highway | service | bonn | New York | Smalltown | :w-north |
201 Then search_name contains
202 | object | nameaddress_vector |
203 | W1 | bonn, new york, smalltown |
205 Scenario: A known addr:* tag is added even if the name is unknown
206 Given the scene roads-with-pois
208 | osm | class | type | name | addr+city | geometry |
209 | W1 | highway | residential | Road | Nandu | :w-north |
211 Then search_name contains
212 | object | nameaddress_vector |
215 Scenario: addr:postcode is not added to the address terms
216 Given the scene roads-with-pois
218 | osm | class | type | name+ref | geometry |
219 | N1 | place | state | 12345 | 80 80 |
221 | osm | class | type | addr+postcode | geometry |
222 | W1 | highway | residential | 12345 | :w-north |
224 Then search_name contains not
225 | object | nameaddress_vector |
228 Scenario: a linked place does not show up in search name
229 Given the named places
230 | osm | class | type | admin | geometry |
231 | R13 | boundary | administrative | 9 | poly-area:0.01 |
233 | osm | class | type | geometry |
234 | N2 | place | city | 0.1 0.1 |
236 | id | members | tags+type |
237 | 13 | N2:label | boundary |
240 | object | linked_place_id |
242 And search_name has no entry for N2
244 Scenario: a linked waterway does not show up in search name
245 Given the scene split-road
247 | osm | class | type | name | geometry |
248 | W1 | waterway | river | Rhein | :w-2 |
249 | W2 | waterway | river | Rhein | :w-3 |
250 | R13 | waterway | river | Rhein | :w-1 + :w-2 + :w-3 |
252 | id | members | tags+type |
253 | 13 | W1,W2:main_stream | waterway |
256 | object | linked_place_id |
259 And search_name has no entry for W1
260 And search_name has no entry for W2