Skip to content

Commit 23e8197

Browse files
migurskiclaude
andcommitted
Add Overture land features to Landuse layer; narrow Earth filter to subtype=land
Implement the following plan: Add Overture `land` Features to Landuse Layer. We should narrow what gets through the earth filter, it really should just be land vs. water over there, not types of land. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2dccd9d commit 23e8197

2 files changed

Lines changed: 25 additions & 2 deletions

File tree

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
7878
public void processOverture(SourceFeature sf, FeatureCollector features) {
7979
String type = sf.getString("type");
8080

81-
// Filter by type field - Overture base theme land
82-
if (!"land".equals(type)) {
81+
// Filter by type field - Overture base theme land, subtype land only
82+
// Other subtypes (forest, grass, shrub, wetland, rock, sand, ice) go to Landuse
83+
if (!"land".equals(type) || !"land".equals(sf.getString("subtype"))) {
8384
return;
8485
}
8586

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,28 @@ public void processOverture(SourceFeature sf, FeatureCollector features) {
262262
return;
263263
}
264264

265+
if ("land".equals(sf.getString("type"))) {
266+
String landClass = sf.getString("class");
267+
String kind = switch (landClass) {
268+
case "wood", "forest" -> "wood";
269+
case "grassland", "grass", "meadow", "fell" -> "grassland";
270+
case "scrub", "heath", "shrub", "shrubbery" -> "scrub";
271+
case "wetland" -> "wetland";
272+
case "bare_rock", "scree", "stone", "rock", "shingle" -> "bare_rock";
273+
case "beach" -> "beach";
274+
case "sand" -> "sand";
275+
default -> null;
276+
};
277+
if (kind != null && sf.canBePolygon()) {
278+
features.polygon(LAYER_NAME)
279+
.setAttr("kind", kind)
280+
.setAttr("sort_rank", 189)
281+
.setZoomRange(7, 15)
282+
.setMinPixelSize(2.0);
283+
}
284+
return;
285+
}
286+
265287
if (/* !"land_cover".equals(sf.getString("type")) && */ !"land_use".equals(sf.getString("type"))) {
266288
return;
267289
}

0 commit comments

Comments
 (0)