From aa01d1e30a3f6ff30381091e84fa11ab845f2c87 Mon Sep 17 00:00:00 2001 From: Oliver Wipfli Date: Tue, 3 Jun 2025 11:09:38 +0200 Subject: [PATCH 1/4] Fix aeroway polygons --- .../java/com/protomaps/basemap/layers/Landuse.java | 2 +- .../java/com/protomaps/basemap/layers/LanduseTest.java | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/tiles/src/main/java/com/protomaps/basemap/layers/Landuse.java b/tiles/src/main/java/com/protomaps/basemap/layers/Landuse.java index 7e6fee0de..c91383206 100644 --- a/tiles/src/main/java/com/protomaps/basemap/layers/Landuse.java +++ b/tiles/src/main/java/com/protomaps/basemap/layers/Landuse.java @@ -177,7 +177,7 @@ public class Landuse implements ForwardingProfile.LayerPostProcessor { ), rule( with("area:aeroway", "taxiway", "runway"), - use("kind", "other") + use("kind", fromTag("area:aeroway")) ), rule( with("place", "neighbourhood"), diff --git a/tiles/src/test/java/com/protomaps/basemap/layers/LanduseTest.java b/tiles/src/test/java/com/protomaps/basemap/layers/LanduseTest.java index f0e0aca3a..f720e7538 100644 --- a/tiles/src/test/java/com/protomaps/basemap/layers/LanduseTest.java +++ b/tiles/src/test/java/com/protomaps/basemap/layers/LanduseTest.java @@ -39,6 +39,16 @@ void testFromTagAeroway() { List.of(Map.of("kind", "runway")), processWith("aeroway", "runway") ); + + assertFeatures(15, + List.of(Map.of("kind", "runway")), + processWith("area:aeroway", "runway") + ); + + assertFeatures(15, + List.of(Map.of("kind", "taxiway")), + processWith("area:aeroway", "taxiway") + ); } @Test From 7f90deb09979ea1cbe1f9cc39d84fc9097bf19af Mon Sep 17 00:00:00 2001 From: Oliver Wipfli Date: Tue, 3 Jun 2025 11:45:54 +0200 Subject: [PATCH 2/4] Remove --- .../main/java/com/protomaps/basemap/layers/Landuse.java | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tiles/src/main/java/com/protomaps/basemap/layers/Landuse.java b/tiles/src/main/java/com/protomaps/basemap/layers/Landuse.java index c91383206..ec1a88f2d 100644 --- a/tiles/src/main/java/com/protomaps/basemap/layers/Landuse.java +++ b/tiles/src/main/java/com/protomaps/basemap/layers/Landuse.java @@ -95,13 +95,10 @@ public class Landuse implements ForwardingProfile.LayerPostProcessor { cemetery commercial grass - farmland - residential military village_green allotments forest - meadow grass """), use("kind", fromTag("landuse")) @@ -132,8 +129,6 @@ public class Landuse implements ForwardingProfile.LayerPostProcessor { grassland scrub sand - wetland - bare_rock """), use("kind", fromTag("natural")) ), @@ -167,10 +162,6 @@ public class Landuse implements ForwardingProfile.LayerPostProcessor { with("landuse", "brownfield"), use("kind", "industrial") ), - rule( - with("landuse", "farmyard", "orchard"), - use("kind", "farmland") - ), rule( with("man_made", "bridge"), use("kind", "pedestrian") From 7fe0c17c4e27194569d88c7729c5b37f54de6468 Mon Sep 17 00:00:00 2001 From: Oliver Wipfli Date: Tue, 3 Jun 2025 12:27:47 +0200 Subject: [PATCH 3/4] Remove --- styles/src/base_layers.ts | 10 +++++++++ .../com/protomaps/basemap/layers/Landuse.java | 21 ++----------------- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/styles/src/base_layers.ts b/styles/src/base_layers.ts index 0d265dd0d..8e2060009 100644 --- a/styles/src/base_layers.ts +++ b/styles/src/base_layers.ts @@ -250,6 +250,16 @@ export function nolabels_layers( "fill-color": t.runway, }, }, + { + id: "unused_landuse", + type: "fill", + source: source, + "source-layer": "landuse", + filter: ["in", "kind", "bare_rock"], + paint: { + "fill-color": "red", + }, + }, { id: "water", type: "fill", diff --git a/tiles/src/main/java/com/protomaps/basemap/layers/Landuse.java b/tiles/src/main/java/com/protomaps/basemap/layers/Landuse.java index ec1a88f2d..e26e80b9a 100644 --- a/tiles/src/main/java/com/protomaps/basemap/layers/Landuse.java +++ b/tiles/src/main/java/com/protomaps/basemap/layers/Landuse.java @@ -239,12 +239,9 @@ public void processOsm(SourceFeature sf, FeatureCollector features) { String kind = getString(sf, matches, "kind", "other"); features.polygon(this.name()) - .setId(FeatureId.create(sf)) + .setId(1) // Core Tilezen schema properties .setAttr("kind", kind) - .setAttr("sort_rank", 189) - // NOTE: (nvkelso 20230622) Consider zoom 5 instead... - // But to match Protomaps v2 we do earlier .setZoomRange(2, 15) .setMinPixelSize(2.0); @@ -260,20 +257,6 @@ public String name() { @Override public List postProcess(int zoom, List items) throws GeometryException { - if (zoom == 15) - return items; - int minArea = 400 / (4096 * 4096) * (256 * 256); - if (zoom == 6) - minArea = 600 / (4096 * 4096) * (256 * 256); - else if (zoom <= 5) - minArea = 800 / (4096 * 4096) * (256 * 256); - items = Area.filterArea(items, minArea); - - // We only care about park boundaries inside groups of adjacent parks at higher zooms when they are labeled - // so at lower zooms we merge them to reduce file size - if (zoom <= 6) { - return FeatureMerge.mergeNearbyPolygons(items, 3.125, 3.125, 0.5, 0.5); - } - return items; + return FeatureMerge.mergeNearbyPolygons(items, 3.125, 3.125, 0.5, 0.5); } } From 39b8f1cef2b88d761dc34f79df00f25998c5c557 Mon Sep 17 00:00:00 2001 From: Oliver Wipfli Date: Tue, 3 Jun 2025 17:45:49 +0200 Subject: [PATCH 4/4] Revert styles --- styles/src/base_layers.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/styles/src/base_layers.ts b/styles/src/base_layers.ts index 8e2060009..0d265dd0d 100644 --- a/styles/src/base_layers.ts +++ b/styles/src/base_layers.ts @@ -250,16 +250,6 @@ export function nolabels_layers( "fill-color": t.runway, }, }, - { - id: "unused_landuse", - type: "fill", - source: source, - "source-layer": "landuse", - filter: ["in", "kind", "bare_rock"], - paint: { - "fill-color": "red", - }, - }, { id: "water", type: "fill",