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
This commit is contained in:
Peter Hanecak
2024-08-27 16:18:17 +02:00
committed by GitHub
parent f35a7686b7
commit bf26194a8c

View File

@@ -17,6 +17,7 @@ import com.onthegomap.planetiler.stats.Stats;
import com.onthegomap.planetiler.util.Translations; import com.onthegomap.planetiler.util.Translations;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Stream; import java.util.stream.Stream;
import org.openmaptiles.addons.ExtraLayers; import org.openmaptiles.addons.ExtraLayers;
import org.openmaptiles.generated.OpenMapTilesSchema; import org.openmaptiles.generated.OpenMapTilesSchema;
@@ -141,6 +142,11 @@ public class OpenMapTilesProfile extends ForwardingProfile {
} }
} }
@Override
public Map<String, List<String>> dependsOnLayer() {
return Map.of("transportation_name", List.of("transportation"));
}
/** Returns the imposm3 table row constructors that match an input element's tags. */ /** Returns the imposm3 table row constructors that match an input element's tags. */
public List<MultiExpression.Match<RowDispatch>> getTableMatches(SourceFeature input) { public List<MultiExpression.Match<RowDispatch>> getTableMatches(SourceFeature input) {
return osmMappings.getMatchesWithTriggers(input); return osmMappings.getMatchesWithTriggers(input);