2 Feature: Import into placex
3 Tests that data in placex is completed correctly.
5 Scenario: No country code tag is available
7 | osm | class | type | geometry |
8 | N1 | highway | primary | country:us |
11 | object | addr+country | country_code |
14 Scenario: Location overwrites country code tag
15 Given the named places
16 | osm | class | type | country | geometry |
17 | N1 | highway | primary | de | country:us |
20 | object | addr+country | country_code |
23 Scenario: Country code tag overwrites location for countries
24 Given the named places
25 | osm | class | type | admin | country | geometry |
26 | R1 | boundary | administrative | 2 | de | (-100 40, -101 40, -101 41, -100 41, -100 40) |
29 | object | rank_search| addr+country | country_code |
32 Scenario: Illegal country code tag for countries is ignored
33 Given the named places
34 | osm | class | type | admin | country | geometry |
35 | R1 | boundary | administrative | 2 | xx | (-100 40, -101 40, -101 41, -100 41, -100 40) |
38 | object | addr+country | country_code |
41 Scenario: admin level is copied over
42 Given the named places
43 | osm | class | type | admin |
44 | N1 | place | state | 3 |
47 | object | admin_level |
50 Scenario: postcode node without postcode is dropped
52 | osm | class | type | name+ref |
53 | N1 | place | postcode | 12334 |
55 Then placex has no entry for N1
57 Scenario: postcode boundary without postcode is dropped
62 | osm | class | type | name+ref | geometry |
63 | R1 | boundary | postal_code | 554476 | (1,2,3,1) |
65 Then placex has no entry for R1
67 Scenario: search and address ranks for boundaries are correctly assigned
68 Given the named places
69 | osm | class | type |
70 | N1 | boundary | administrative |
72 | osm | class | type | geometry |
73 | W10 | boundary | administrative | 10 10, 11 11 |
75 | osm | class | type | admin | geometry |
76 | R20 | boundary | administrative | 2 | (1 1, 2 2, 1 2, 1 1) |
77 | R21 | boundary | administrative | 32 | (3 3, 4 4, 3 4, 3 3) |
78 | R22 | boundary | nature_park | 6 | (0 0, 1 0, 0 1, 0 0) |
79 | R23 | boundary | natural_reserve| 10 | (0 0, 1 1, 1 0, 0 0) |
81 | osm | class | type | geometry |
82 | R40 | place | country | (1 1, 2 2, 1 2, 1 1) |
83 | R41 | place | state | (3 3, 4 4, 3 4, 3 3) |
85 Then placex has no entry for N1
86 And placex has no entry for W10
88 | object | rank_search | rank_address |
96 Scenario: search and address ranks for highways correctly assigned
98 | 10 | 1 | 11 | | 12 | | 13 | | 14 | | 15 | | 16 |
100 | osm | class | type |
101 | N1 | highway | bus_stop |
103 | osm | class | type | geometry |
104 | W1 | highway | primary | 10,11 |
105 | W2 | highway | secondary | 11,12 |
106 | W3 | highway | tertiary | 12,13 |
107 | W4 | highway | residential | 13,14 |
108 | W5 | highway | unclassified | 14,15 |
109 | W6 | highway | something | 15,16 |
112 | object | rank_search | rank_address |
121 Scenario: rank and inclusion of landuses
123 | 1 | 2 | | | | | | 5 |
124 | 4 | 3 | | | | | | 6 |
125 Given the named places
126 | osm | class | type |
127 | N2 | landuse | residential |
129 | osm | class | type | geometry |
130 | W2 | landuse | residential | 1,2,5 |
131 | W4 | landuse | residential | (1,4,3,1) |
132 | R2 | landuse | residential | (1,2,3,4,1) |
133 | R3 | landuse | forrest | (1,5,6,4,1) |
136 | object | rank_search | rank_address |
143 Scenario: rank and inclusion of naturals
145 | 1 | 2 | | | | | | 5 |
146 | 4 | 3 | | | | | | 6 |
147 Given the named places
148 | osm | class | type |
149 | N2 | natural | peak |
150 | N4 | natural | volcano |
151 | N5 | natural | foobar |
153 | osm | class | type | geometry |
154 | W2 | natural | mountain_range | 1,2,5 |
155 | W3 | natural | foobar | 2,3 |
156 | R3 | natural | volcano | (1,2,4,1) |
157 | R4 | natural | foobar | (1,2,3,4,1) |
158 | R5 | natural | sea | (1,2,5,6,3,4,1) |
159 | R6 | natural | sea | (2,3,4,2) |
162 | object | rank_search | rank_address |
173 Scenario: boundary ways for countries and states are ignored
177 Given the named places
178 | osm | class | type | admin | geometry |
179 | W4 | boundary | administrative | 2 | (1,2,3,4,1) |
180 | R4 | boundary | administrative | 2 | (1,2,3,4,1) |
181 | W5 | boundary | administrative | 3 | (1,2,3,4,1) |
182 | R5 | boundary | administrative | 3 | (1,2,3,4,1) |
183 | W6 | boundary | administrative | 4 | (1,2,3,4,1) |
184 | R6 | boundary | administrative | 4 | (1,2,3,4,1) |
185 | W7 | boundary | administrative | 5 | (1,2,3,4,1) |
186 | R7 | boundary | administrative | 5 | (1,2,3,4,1) |
188 Then placex contains exactly