From 0893b1eb1560e632ce435de54c0d65f5bb8c7b2e Mon Sep 17 00:00:00 2001 From: Peter Hanecak <115141505+phanecak-maptiler@users.noreply.github.com> Date: Tue, 6 Aug 2024 15:31:29 +0200 Subject: [PATCH] Use super(config) and caresAboutLayer() in OpenMapTilesProfile ... (#182) use super(config) and caresAboutLayer() in OpenMapTilesProfile ... ... to make sure we're working with onlyLayers and excludeLayers in OpenMapTilesProfile and ForwardingProfile in consistent manner --- src/main/java/org/openmaptiles/OpenMapTilesProfile.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/openmaptiles/OpenMapTilesProfile.java b/src/main/java/org/openmaptiles/OpenMapTilesProfile.java index cd264ce5..5b70625a 100644 --- a/src/main/java/org/openmaptiles/OpenMapTilesProfile.java +++ b/src/main/java/org/openmaptiles/OpenMapTilesProfile.java @@ -60,8 +60,7 @@ public OpenMapTilesProfile(Planetiler runner) { } public OpenMapTilesProfile(Translations translations, PlanetilerConfig config, Stats stats) { - List onlyLayers = config.arguments().getList("only_layers", "Include only certain layers", List.of()); - List excludeLayers = config.arguments().getList("exclude_layers", "Exclude certain layers", List.of()); + super(config); // register release/finish/feature postprocessor/osm relationship handler methods... List layers = new ArrayList<>(); @@ -71,7 +70,7 @@ public OpenMapTilesProfile(Translations translations, PlanetilerConfig config, S var extraLayers = ExtraLayers.create(translations, config, stats); var allLayers = Stream.concat(omtLayers.stream(), extraLayers.stream()).toList(); for (Layer layer : allLayers) { - if ((onlyLayers.isEmpty() || onlyLayers.contains(layer.name())) && !excludeLayers.contains(layer.name())) { + if (caresAboutLayer(layer)) { layers.add(layer); registerHandler(layer); if (layer instanceof TransportationName transportationName) {