From c6acb629fb391fd6ee85052db5a1f5423755d6a6 Mon Sep 17 00:00:00 2001 From: Peter Hanecak Date: Wed, 31 Jul 2024 09:39:02 +0200 Subject: [PATCH] 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) {