1 Feature: Import into placex
2 Tests that data in placex is completed correctly.
4 Scenario: No country code tag is available
6 | osm | class | type | geometry |
7 | N1 | highway | primary | country:us |
10 | object | address | country_code |
13 Scenario: Location overwrites country code tag
14 Given the named places
15 | osm | class | type | country | geometry |
16 | N1 | highway | primary | de | country:us |
19 | object | addr+country | country_code |
22 Scenario: Country code tag overwrites location for countries
23 Given the named places
24 | osm | class | type | admin | country | geometry |
25 | R1 | boundary | administrative | 2 | de | (-100 40, -101 40, -101 41, -100 41, -100 40) |
28 | object | rank_search| addr+country | country_code |
31 Scenario: Illegal country code tag for countries is ignored
32 Given the named places
33 | osm | class | type | admin | country | geometry |
34 | R1 | boundary | administrative | 2 | xx | (-100 40, -101 40, -101 41, -100 41, -100 40) |
37 | object | addr+country | country_code |
40 Scenario: admin level is copied over
41 Given the named places
42 | osm | class | type | admin |
43 | N1 | place | state | 3 |
46 | object | admin_level |
49 Scenario: postcode node without postcode is dropped
51 | osm | class | type | name+ref |
52 | N1 | place | postcode | 12334 |
54 Then placex has no entry for N1
56 Scenario: postcode boundary without postcode is dropped
61 | osm | class | type | name+ref | geometry |
62 | R1 | boundary | postal_code | 554476 | (1,2,3,1) |
64 Then placex has no entry for R1
66 Scenario: search and address ranks for boundaries are correctly assigned
67 Given the named places
68 | osm | class | type |
69 | N1 | boundary | administrative |
71 | osm | class | type | geometry |
72 | W10 | boundary | administrative | 10 10, 11 11 |
74 | osm | class | type | admin | geometry |
75 | R20 | boundary | administrative | 2 | (1 1, 2 2, 1 2, 1 1) |
76 | R21 | boundary | administrative | 32 | (3 3, 4 4, 3 4, 3 3) |
77 | R22 | boundary | nature_park | 6 | (0 0, 1 0, 0 1, 0 0) |
78 | R23 | boundary | natural_reserve| 10 | (0 0, 1 1, 1 0, 0 0) |
80 | osm | class | type | geometry |
81 | R40 | place | country | (1 1, 2 2, 1 2, 1 1) |
82 | R41 | place | state | (3 3, 4 4, 3 4, 3 3) |
84 Then placex has no entry for N1
85 And placex has no entry for W10
87 | object | rank_search | rank_address |
95 Scenario: search and address ranks for highways correctly assigned
97 | 10 | 1 | 11 | | 12 | | 13 | | 14 | | 15 | | 16 |
99 | osm | class | type |
100 | N1 | highway | bus_stop |
102 | osm | class | type | geometry |
103 | W1 | highway | primary | 10,11 |
104 | W2 | highway | secondary | 11,12 |
105 | W3 | highway | tertiary | 12,13 |
106 | W4 | highway | residential | 13,14 |
107 | W5 | highway | unclassified | 14,15 |
108 | W6 | highway | something | 15,16 |
111 | object | rank_search | rank_address |
120 Scenario: rank and inclusion of landuses
122 | 1 | 2 | | | | | | 5 |
123 | 4 | 3 | | | | | | 6 |
124 Given the named places
125 | osm | class | type |
126 | N2 | landuse | residential |
128 | osm | class | type | geometry |
129 | W2 | landuse | residential | 1,2,5 |
130 | W4 | landuse | residential | (1,4,3,1) |
131 | R2 | landuse | residential | (1,2,3,4,1) |
132 | R3 | landuse | forrest | (1,5,6,4,1) |
135 | object | rank_search | rank_address |
142 Scenario: rank and inclusion of naturals
144 | 1 | 2 | | | | | | 5 |
145 | 4 | 3 | | | | | | 6 |
146 Given the named places
147 | osm | class | type |
148 | N2 | natural | peak |
149 | N4 | natural | volcano |
150 | N5 | natural | foobar |
152 | osm | class | type | geometry |
153 | W2 | natural | mountain_range | 1,2,5 |
154 | W3 | natural | foobar | 2,3 |
155 | R3 | natural | volcano | (1,2,4,1) |
156 | R4 | natural | foobar | (1,2,3,4,1) |
157 | R5 | natural | sea | (1,2,5,6,3,4,1) |
158 | R6 | natural | sea | (2,3,4,2) |
161 | object | rank_search | rank_address |
172 Scenario: boundary ways for countries and states are ignored
176 Given the named places
177 | osm | class | type | admin | geometry |
178 | W4 | boundary | administrative | 2 | (1,2,3,4,1) |
179 | R4 | boundary | administrative | 2 | (1,2,3,4,1) |
180 | W5 | boundary | administrative | 3 | (1,2,3,4,1) |
181 | R5 | boundary | administrative | 3 | (1,2,3,4,1) |
182 | W6 | boundary | administrative | 4 | (1,2,3,4,1) |
183 | R6 | boundary | administrative | 4 | (1,2,3,4,1) |
184 | W7 | boundary | administrative | 5 | (1,2,3,4,1) |
185 | R7 | boundary | administrative | 5 | (1,2,3,4,1) |
187 Then placex contains exactly