2 Feature: Import and search of names
3 Tests all naming related issues: normalisation,
4 abbreviations, internationalisation, etc.
7 Scenario: Case-insensitivity of search
9 | osm_id | class | type | name
10 | 1 | place | locality | 'name' : 'FooBar'
12 Then table placex contains
13 | object | class | type | name
14 | N1 | place | locality | 'name' : 'FooBar'
15 When sending query "FooBar"
17 | ID | osm_type | osm_id
19 When sending query "foobar"
21 | ID | osm_type | osm_id
23 When sending query "fOObar"
25 | ID | osm_type | osm_id
27 When sending query "FOOBAR"
29 | ID | osm_type | osm_id
32 Scenario: Multiple spaces in name
34 | osm_id | class | type | name
35 | 1 | place | locality | 'name' : 'one two three'
37 When sending query "one two three"
39 | ID | osm_type | osm_id
41 When sending query "one two three"
43 | ID | osm_type | osm_id
45 When sending query "one two three"
47 | ID | osm_type | osm_id
49 When sending query " one two three"
51 | ID | osm_type | osm_id
54 Scenario: Special characters in name
56 | osm_id | class | type | name
57 | 1 | place | locality | 'name' : 'Jim-Knopf-Str'
58 | 2 | place | locality | 'name' : 'Smith/Weston'
59 | 3 | place | locality | 'name' : 'space mountain'
60 | 4 | place | locality | 'name' : 'space'
61 | 5 | place | locality | 'name' : 'mountain'
63 When sending query "Jim-Knopf-Str"
65 | ID | osm_type | osm_id
67 When sending query "Jim Knopf-Str"
69 | ID | osm_type | osm_id
71 When sending query "Jim Knopf Str"
73 | ID | osm_type | osm_id
75 When sending query "Jim/Knopf-Str"
77 | ID | osm_type | osm_id
79 When sending query "Jim-Knopfstr"
81 | ID | osm_type | osm_id
83 When sending query "Smith/Weston"
85 | ID | osm_type | osm_id
87 When sending query "Smith Weston"
89 | ID | osm_type | osm_id
91 When sending query "Smith-Weston"
93 | ID | osm_type | osm_id
95 When sending query "space mountain"
97 | ID | osm_type | osm_id
99 When sending query "space-mountain"
101 | ID | osm_type | osm_id
103 When sending query "space/mountain"
105 | ID | osm_type | osm_id
107 When sending query "space\mountain"
109 | ID | osm_type | osm_id
111 When sending query "space(mountain)"
113 | ID | osm_type | osm_id
116 Scenario: No copying name tag if only one name
117 Given the place nodes
118 | osm_id | class | type | name | geometry
119 | 1 | place | locality | 'name' : 'german' | country:de
121 Then table placex contains
122 | object | calculated_country_code |
124 And table placex contains as names for N1
128 Scenario: Copying name tag to default language if it does not exist
129 Given the place nodes
130 | osm_id | class | type | name | geometry
131 | 1 | place | locality | 'name' : 'german', 'name:fi' : 'finnish' | country:de
133 Then table placex contains
134 | object | calculated_country_code |
136 And table placex contains as names for N1
142 Scenario: Copying default language name tag to name if it does not exist
143 Given the place nodes
144 | osm_id | class | type | name | geometry
145 | 1 | place | locality | 'name:de' : 'german', 'name:fi' : 'finnish' | country:de
147 Then table placex contains
148 | object | calculated_country_code |
150 And table placex contains as names for N1
156 Scenario: Do not overwrite default language with name tag
157 Given the place nodes
158 | osm_id | class | type | name | geometry
159 | 1 | place | locality | 'name' : 'german', 'name:fi' : 'finnish', 'name:de' : 'local' | country:de
161 Then table placex contains
162 | object | calculated_country_code |
164 And table placex contains as names for N1
170 Scenario: Landuse with name are found
171 Given the place areas
172 | osm_type | osm_id | class | type | name | geometry
173 | R | 1 | natural | meadow | 'name' : 'landuse1' | (0 0, 1 0, 1 1, 0 1, 0 0)
174 | R | 2 | landuse | industrial | 'name' : 'landuse2' | (0 0, -1 0, -1 -1, 0 -1, 0 0)
176 When sending query "landuse1"
178 | ID | osm_type | osm_id
180 When sending query "landuse2"
182 | ID | osm_type | osm_id
185 Scenario: Postcode boundaries without ref
186 Given the place areas
187 | osm_type | osm_id | class | type | postcode | geometry
188 | R | 1 | boundary | postal_code | 12345 | (0 0, 1 0, 1 1, 0 1, 0 0)
190 When sending query "12345"
192 | ID | osm_type | osm_id