22
22
23
23
public class Landuse implements ForwardingProfile .LayerPostProcessor {
24
24
25
+ private static final List <String > US_FOREST_OPERATORS = List .of ("operator" , "United States Forest Service" ,
26
+ "US Forest Service" , "U.S. Forest Service" , "USDA Forest Service" , "United States Department of Agriculture" ,
27
+ "US National Forest Service" , "United State Forest Service" , "U.S. National Forest Service" );
28
+ private static final List <String > PROTECTION_TITLES =
29
+ List .of ("protection_title" , "Conservation Area" , "Conservation Park" , "Environmental use" , "Forest Reserve" ,
30
+ "National Forest" , "National Wildlife Refuge" , "Nature Refuge" , "Nature Reserve" , "Protected Site" ,
31
+ "Provincial Park" , "Public Access Land" , "Regional Reserve" , "Resources Reserve" , "State Forest" ,
32
+ "State Game Land" , "State Park" , "Watershed Recreation Unit" , "Wild Forest" , "Wilderness Area" ,
33
+ "Wilderness Study Area" , "Wildlife Management" , "Wildlife Management Area" , "Wildlife Sanctuary" );
34
+
25
35
private static final MultiExpression .Index <Map <String , Object >> index = MultiExpression .of (List .of (
26
- rule (
27
- with ("area:aeroway" , "taxiway" , "runway" ),
28
- use ("kind" , "other" )
29
- ),
30
36
rule (
31
37
with ("aeroway" , "aerodrome" , "runway" ),
32
38
use ("kind" , fromTag ("aeroway" ))
33
39
),
34
40
rule (
35
- with ("amenity" , "hospital" , "school" , "kindergarten" , "university" , "college" , "library" , "post_office" ,
36
- "townhall" , "cafe" ),
41
+ with ("amenity" , "hospital" , "school" , "kindergarten" , "university" , "college" ),
37
42
use ("kind" , fromTag ("amenity" ))
38
43
),
39
44
rule (
40
- with ("boundary" , "national_park" , "protected_area" ),
41
- use ("kind" , fromTag ("boundary" ))
42
- ),
43
- rule (
44
- with ("landuse" , "recreation_ground" , "railway" , "commercial" , "grass" , "forest" , "meadow" , "grass" ),
45
- use ("kind" , "other" )
45
+ with ("boundary" , "protected_area" ),
46
+ use ("kind" , "protected_area" )
46
47
),
47
48
rule (
48
- with ("landuse" , "cemetery" , "residential" , "village_green" , "allotments" , "military" ),
49
+ with ("landuse" , "recreation_ground" , "industrial" , "railway" , "cemetery" , "commercial" , "grass" , "farmland" ,
50
+ "residential" , "military" , "village_green" , "allotments" , "forest" , "meadow" , "grass" ),
49
51
use ("kind" , fromTag ("landuse" ))
50
52
),
51
53
rule (
52
- with ("landuse" , "orchard" , "farmland" , "farmyard" ),
53
- use ("kind" , "farmland" )
54
- ),
55
- rule (
56
- with ("landuse" , "industrial" , "brownfield" ),
57
- use ("kind" , "industrial" )
58
- ),
59
- rule (
60
- with ("landuse" , "military" ),
61
- with ("military" , "naval_base" , "airfield" ),
62
- use ("kind" , fromTag ("military" ))
63
- ),
64
- rule (
65
- with ("leisure" , "golf_course" , "marina" , "park" , "stadium" , "playground" , "garden" , "dog_park" , "pitch" ,
66
- "nature_reserve" ),
54
+ with ("leisure" , "park" , "garden" , "golf_course" , "dog_park" , "playground" , "pitch" , "nature_reserve" ),
67
55
use ("kind" , fromTag ("leisure" ))
68
56
),
69
- rule (
70
- with ("man_made" , "bridge" ),
71
- use ("kind" , "pedestrian" )
72
- ),
73
57
rule (
74
58
with ("man_made" , "pier" ),
75
59
use ("kind" , "pier" )
@@ -79,129 +63,86 @@ public class Landuse implements ForwardingProfile.LayerPostProcessor {
79
63
use ("kind" , fromTag ("natural" ))
80
64
),
81
65
rule (
82
- with ("place" , "neighbourhood" ),
83
- use ("kind" , "other" )
66
+ with ("highway" , "pedestrian" , "footway" ),
67
+ with ("area" , "yes" ),
68
+ use ("kind" , "pedestrian" )
84
69
),
85
70
rule (
86
71
with ("railway" , "platform" ),
87
72
use ("kind" , "platform" )
88
73
),
89
74
rule (
90
75
with ("tourism" , "zoo" ),
91
- use ("kind" , "other" )
92
- ),
93
- rule (
94
- with ("tourism" , "attraction" , "camp_site" , "hotel" ),
95
- use ("kind" , fromTag ("tourism" ))
76
+ use ("kind" , "zoo" )
96
77
),
97
78
rule (
98
- with ("area " , "yes " ),
99
- with ("highway " , "pedestrian " , "footway " ),
100
- use ("kind" , "pedestrian" )
79
+ with ("landuse " , "military " ),
80
+ with ("military " , "airfield " , "naval_base " ),
81
+ use ("kind" , fromTag ( "military" ) )
101
82
),
102
83
rule (
103
- with ("shop " , "grocery" , "supermarket " ),
104
- use ("kind" , fromTag ( "shop" ) )
84
+ with ("landuse " , "brownfield " ),
85
+ use ("kind" , "industrial" )
105
86
),
106
87
rule (
107
- with ("boundary" , "national_park" ),
108
- with ("operator" , "United States Forest Service" , "US Forest Service" , "U.S. Forest Service" ,
109
- "USDA Forest Service" , "United States Department of Agriculture" , "US National Forest Service" ,
110
- "United State Forest Service" , "U.S. National Forest Service" ),
111
- use ("kind" , "forest" )
88
+ with ("landuse" , "farmyard" , "orchard" ),
89
+ use ("kind" , "farmland" )
112
90
),
113
91
rule (
114
- with ("boundary" , "national_park" ),
115
- with ("protect_class" , "6" ),
116
- with ("protection_title" , "National Forest" ),
117
- use ("kind" , "forest" )
92
+ with ("man_made" , "bridge" ),
93
+ use ("kind" , "pedestrian" )
118
94
),
119
95
rule (
120
- with ("landuse" , "forest" ),
121
- with ("protect_class" , "6" ),
122
- use ("kind" , "forest" )
96
+ with ("area:aeroway" , "taxiway" , "runway" ),
97
+ use ("kind" , "other" )
123
98
),
124
99
rule (
125
- with ("landuse" , "forest" ),
126
- with ("operator" , "United States Forest Service" , "US Forest Service" , "U.S. Forest Service" ,
127
- "USDA Forest Service" , "United States Department of Agriculture" , "US National Forest Service" ,
128
- "United State Forest Service" , "U.S. National Forest Service" ),
129
- use ("kind" , "forest" )
100
+ with ("place" , "neighbourhood" ),
101
+ use ("kind" , "other" )
130
102
),
131
103
rule (
132
- with ("landuse" , "forest" ),
104
+ with ("boundary" , "protected_area" ),
105
+ with ("protect_class" , "6" ),
106
+ with (US_FOREST_OPERATORS .toArray (String []::new )),
133
107
use ("kind" , "forest" )
134
108
),
135
109
rule (
136
110
with ("boundary" , "national_park" ),
137
111
use ("kind" , "park" )
138
112
),
139
113
rule (
140
- with ("boundary" , "protected_area" ),
141
- with ("protect_class" , "6" ),
142
- with ("operator" , "United States Forest Service" , "US Forest Service" , "U.S. Forest Service" ,
143
- "USDA Forest Service" , "United States Department of Agriculture" , "US National Forest Service" ,
144
- "United State Forest Service" , "U.S. National Forest Service" ),
145
- use ("kind" , "forest" )
146
- ),
147
- rule (
148
- without ("operator" , "United States Forest Service" , "US Forest Service" , "U.S. Forest Service" ,
149
- "USDA Forest Service" , "United States Department of Agriculture" , "US National Forest Service" ,
150
- "United State Forest Service" , "U.S. National Forest Service" ),
151
- without ("protection_title" , "Conservation Area" , "Conservation Park" , "Environmental use" , "Forest Reserve" ,
152
- "National Forest" , "National Wildlife Refuge" , "Nature Refuge" , "Nature Reserve" , "Protected Site" ,
153
- "Provincial Park" , "Public Access Land" , "Regional Reserve" , "Resources Reserve" , "State Forest" ,
154
- "State Game Land" , "State Park" , "Watershed Recreation Unit" , "Wild Forest" , "Wilderness Area" ,
155
- "Wilderness Study Area" , "Wildlife Management" , "Wildlife Management Area" , "Wildlife Sanctuary" ),
114
+ with ("boundary" , "national_park" ),
115
+ without (US_FOREST_OPERATORS .toArray (String []::new )),
116
+ without (PROTECTION_TITLES .toArray (String []::new )),
156
117
with ("protect_class" , "2" , "3" ),
157
118
use ("kind" , "national_park" )
158
119
),
159
120
rule (
160
- without ("operator" , "United States Forest Service" , "US Forest Service" , "U.S. Forest Service" ,
161
- "USDA Forest Service" , "United States Department of Agriculture" , "US National Forest Service" ,
162
- "United State Forest Service" , "U.S. National Forest Service" ),
163
- without ("protection_title" , "Conservation Area" , "Conservation Park" , "Environmental use" , "Forest Reserve" ,
164
- "National Forest" , "National Wildlife Refuge" , "Nature Refuge" , "Nature Reserve" , "Protected Site" ,
165
- "Provincial Park" , "Public Access Land" , "Regional Reserve" , "Resources Reserve" , "State Forest" ,
166
- "State Game Land" , "State Park" , "Watershed Recreation Unit" , "Wild Forest" , "Wilderness Area" ,
167
- "Wilderness Study Area" , "Wildlife Management" , "Wildlife Management Area" , "Wildlife Sanctuary" ),
168
- with ("operator" , "United States National Park Service" , "National Park Service" ,
169
- "US National Park Service" , "U.S. National Park Service" , "US National Park service" ),
121
+ with ("boundary" , "national_park" ),
122
+ without (US_FOREST_OPERATORS .toArray (String []::new )),
123
+ without (PROTECTION_TITLES .toArray (String []::new )),
124
+ with ("operator" , "United States National Park Service" , "National Park Service" , "US National Park Service" ,
125
+ "U.S. National Park Service" , "US National Park service" ),
170
126
use ("kind" , "national_park" )
171
127
),
172
128
rule (
173
- without ("operator" , "United States Forest Service" , "US Forest Service" , "U.S. Forest Service" ,
174
- "USDA Forest Service" , "United States Department of Agriculture" , "US National Forest Service" ,
175
- "United State Forest Service" , "U.S. National Forest Service" ),
176
- without ("protection_title" , "Conservation Area" , "Conservation Park" , "Environmental use" , "Forest Reserve" ,
177
- "National Forest" , "National Wildlife Refuge" , "Nature Refuge" , "Nature Reserve" , "Protected Site" ,
178
- "Provincial Park" , "Public Access Land" , "Regional Reserve" , "Resources Reserve" , "State Forest" ,
179
- "State Game Land" , "State Park" , "Watershed Recreation Unit" , "Wild Forest" , "Wilderness Area" ,
180
- "Wilderness Study Area" , "Wildlife Management" , "Wildlife Management Area" , "Wildlife Sanctuary" ),
129
+ with ("boundary" , "national_park" ),
130
+ without (US_FOREST_OPERATORS .toArray (String []::new )),
131
+ without (PROTECTION_TITLES .toArray (String []::new )),
181
132
with ("operator:en" , "Parks Canada" ),
182
133
use ("kind" , "national_park" )
183
134
),
184
135
rule (
185
- without ("operator" , "United States Forest Service" , "US Forest Service" , "U.S. Forest Service" ,
186
- "USDA Forest Service" , "United States Department of Agriculture" , "US National Forest Service" ,
187
- "United State Forest Service" , "U.S. National Forest Service" ),
188
- without ("protection_title" , "Conservation Area" , "Conservation Park" , "Environmental use" , "Forest Reserve" ,
189
- "National Forest" , "National Wildlife Refuge" , "Nature Refuge" , "Nature Reserve" , "Protected Site" ,
190
- "Provincial Park" , "Public Access Land" , "Regional Reserve" , "Resources Reserve" , "State Forest" ,
191
- "State Game Land" , "State Park" , "Watershed Recreation Unit" , "Wild Forest" , "Wilderness Area" ,
192
- "Wilderness Study Area" , "Wildlife Management" , "Wildlife Management Area" , "Wildlife Sanctuary" ),
136
+ with ("boundary" , "national_park" ),
137
+ without (US_FOREST_OPERATORS .toArray (String []::new )),
138
+ without (PROTECTION_TITLES .toArray (String []::new )),
193
139
with ("designation" , "national_park" ),
194
140
use ("kind" , "national_park" )
195
141
),
196
142
rule (
197
- without ("operator" , "United States Forest Service" , "US Forest Service" , "U.S. Forest Service" ,
198
- "USDA Forest Service" , "United States Department of Agriculture" , "US National Forest Service" ,
199
- "United State Forest Service" , "U.S. National Forest Service" ),
200
- without ("protection_title" , "Conservation Area" , "Conservation Park" , "Environmental use" , "Forest Reserve" ,
201
- "National Forest" , "National Wildlife Refuge" , "Nature Refuge" , "Nature Reserve" , "Protected Site" ,
202
- "Provincial Park" , "Public Access Land" , "Regional Reserve" , "Resources Reserve" , "State Forest" ,
203
- "State Game Land" , "State Park" , "Watershed Recreation Unit" , "Wild Forest" , "Wilderness Area" ,
204
- "Wilderness Study Area" , "Wildlife Management" , "Wildlife Management Area" , "Wildlife Sanctuary" ),
143
+ with ("boundary" , "national_park" ),
144
+ without (US_FOREST_OPERATORS .toArray (String []::new )),
145
+ without (PROTECTION_TITLES .toArray (String []::new )),
205
146
with ("protection_title" , "National Park" ),
206
147
use ("kind" , "national_park" )
207
148
)
0 commit comments