Skip to content

Commit 06c4489

Browse files
committed
Rework landuse
1 parent 5536b93 commit 06c4489

File tree

2 files changed

+537
-145
lines changed

2 files changed

+537
-145
lines changed

tiles/src/main/java/com/protomaps/basemap/layers/Landuse.java

+53-112
Original file line numberDiff line numberDiff line change
@@ -22,54 +22,38 @@
2222

2323
public class Landuse implements ForwardingProfile.LayerPostProcessor {
2424

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+
2535
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-
),
3036
rule(
3137
with("aeroway", "aerodrome", "runway"),
3238
use("kind", fromTag("aeroway"))
3339
),
3440
rule(
35-
with("amenity", "hospital", "school", "kindergarten", "university", "college", "library", "post_office",
36-
"townhall", "cafe"),
41+
with("amenity", "hospital", "school", "kindergarten", "university", "college"),
3742
use("kind", fromTag("amenity"))
3843
),
3944
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")
4647
),
4748
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"),
4951
use("kind", fromTag("landuse"))
5052
),
5153
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"),
6755
use("kind", fromTag("leisure"))
6856
),
69-
rule(
70-
with("man_made", "bridge"),
71-
use("kind", "pedestrian")
72-
),
7357
rule(
7458
with("man_made", "pier"),
7559
use("kind", "pier")
@@ -79,129 +63,86 @@ public class Landuse implements ForwardingProfile.LayerPostProcessor {
7963
use("kind", fromTag("natural"))
8064
),
8165
rule(
82-
with("place", "neighbourhood"),
83-
use("kind", "other")
66+
with("highway", "pedestrian", "footway"),
67+
with("area", "yes"),
68+
use("kind", "pedestrian")
8469
),
8570
rule(
8671
with("railway", "platform"),
8772
use("kind", "platform")
8873
),
8974
rule(
9075
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")
9677
),
9778
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"))
10182
),
10283
rule(
103-
with("shop", "grocery", "supermarket"),
104-
use("kind", fromTag("shop"))
84+
with("landuse", "brownfield"),
85+
use("kind", "industrial")
10586
),
10687
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")
11290
),
11391
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")
11894
),
11995
rule(
120-
with("landuse", "forest"),
121-
with("protect_class", "6"),
122-
use("kind", "forest")
96+
with("area:aeroway", "taxiway", "runway"),
97+
use("kind", "other")
12398
),
12499
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")
130102
),
131103
rule(
132-
with("landuse", "forest"),
104+
with("boundary", "protected_area"),
105+
with("protect_class", "6"),
106+
with(US_FOREST_OPERATORS.toArray(String[]::new)),
133107
use("kind", "forest")
134108
),
135109
rule(
136110
with("boundary", "national_park"),
137111
use("kind", "park")
138112
),
139113
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)),
156117
with("protect_class", "2", "3"),
157118
use("kind", "national_park")
158119
),
159120
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"),
170126
use("kind", "national_park")
171127
),
172128
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)),
181132
with("operator:en", "Parks Canada"),
182133
use("kind", "national_park")
183134
),
184135
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)),
193139
with("designation", "national_park"),
194140
use("kind", "national_park")
195141
),
196142
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)),
205146
with("protection_title", "National Park"),
206147
use("kind", "national_park")
207148
)

0 commit comments

Comments
 (0)