From bf26194a8c6a3d7bb866a529249afdc46e17516f Mon Sep 17 00:00:00 2001 From: Peter Hanecak <115141505+phanecak-maptiler@users.noreply.github.com> Date: Tue, 27 Aug 2024 16:18:17 +0200 Subject: [PATCH] use dependsOnLayer() ... (#189) * use dependsOnLayer() ... ... to make sure caresAboutLayer() properly handles the situation when 'transportation_name' depends on 'transportation' hence: - when 'transportation' is exluded, then also 'transportation_name' needs to be also treated as exluded - when 'transportation' is included (e.g. mentioned in --only-layers) then 'transportation_name' needs to be also treated as included * dependsOnLayer() adjusted to match changes in the planetiler-core --- src/main/java/org/openmaptiles/OpenMapTilesProfile.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/org/openmaptiles/OpenMapTilesProfile.java b/src/main/java/org/openmaptiles/OpenMapTilesProfile.java index 5b70625..bafa1a3 100644 --- a/src/main/java/org/openmaptiles/OpenMapTilesProfile.java +++ b/src/main/java/org/openmaptiles/OpenMapTilesProfile.java @@ -17,6 +17,7 @@ import com.onthegomap.planetiler.stats.Stats; import com.onthegomap.planetiler.util.Translations; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.stream.Stream; import org.openmaptiles.addons.ExtraLayers; import org.openmaptiles.generated.OpenMapTilesSchema; @@ -141,6 +142,11 @@ public class OpenMapTilesProfile extends ForwardingProfile { } } + @Override + public Map> dependsOnLayer() { + return Map.of("transportation_name", List.of("transportation")); + } + /** Returns the imposm3 table row constructors that match an input element's tags. */ public List> getTableMatches(SourceFeature input) { return osmMappings.getMatchesWithTriggers(input);