1 Feature: Country handling
2 Tests for import and use of country information
4 Scenario: Country names from OSM country relations are added
6 | osm | class | type | admin | name+name:xy | country | geometry |
7 | R1 | boundary | administrative | 2 | Loudou | de | (9 52, 9 53, 10 52, 9 52) |
9 | osm | class | type | name | geometry |
10 | N1 | place | town | Wenig | country:de |
12 When geocoding "Wenig, Loudou"
13 Then the result set contains
14 | object | display_name |
15 | N1 | Wenig, Deutschland |
16 When geocoding "Wenig"
19 Then the result set contains
20 | object | display_name |
21 | N1 | Wenig, Loudou |
23 Scenario: OSM country relations outside expected boundaries are ignored for naming
28 | osm | class | type | admin | name+name:xy | country | geometry |
29 | R1 | boundary | administrative | 2 | Loudou | de | (1,2,3,4,1) |
31 | osm | class | type | name | geometry |
32 | N1 | place | town | Wenig | country:de |
34 When geocoding "Wenig"
37 Then the result set contains
38 | object | display_name |
39 | N1 | Wenig, Germany |
41 Scenario: Pre-defined country names are used
42 Given the grid with origin CH
45 | osm | class | type | name | geometry |
46 | N1 | place | town | Ingb | 1 |
51 Then the result set contains
52 | object | display_name |
53 | N1 | Ingb, Switzerland |
55 Scenario: For overlapping countries, pre-defined countries are tie-breakers
56 Given the grid with origin US
60 Given the named places
61 | osm | class | type | admin | country | geometry |
62 | R1 | boundary | administrative | 2 | de | (1,5,6,4,1) |
63 | R2 | boundary | administrative | 2 | us | (1,2,3,4,1) |
65 | osm | class | type | geometry |
66 | N1 | place | town | 9 |
67 | N2 | place | town | 8 |
70 | object | country_code |
74 Scenario: For overlapping countries outside pre-define countries prefer smaller partition
75 Given the grid with origin US
79 Given the named places
80 | osm | class | type | admin | country | geometry |
81 | R1 | boundary | administrative | 2 | ch | (1,5,6,4,1) |
82 | R2 | boundary | administrative | 2 | de | (1,2,3,4,1) |
84 | osm | class | type | geometry |
85 | N1 | place | town | 9 |
86 | N2 | place | town | 8 |
89 | object | country_code |