diff --git a/src/main/java/org/openmaptiles/layers/Transportation.java b/src/main/java/org/openmaptiles/layers/Transportation.java index 6408c015..1a6d9411 100644 --- a/src/main/java/org/openmaptiles/layers/Transportation.java +++ b/src/main/java/org/openmaptiles/layers/Transportation.java @@ -156,8 +156,6 @@ public class Transportation implements .put(6, 100) .put(5, 500) .put(4, 1_000); - // "shipway_linestring_gen_z5: ... tolerance: ZRES6", etc. when recalculated from meters to pixels is always: - private static final double FERRY_TOLERANCE = 0.5; // ORDER BY network_type, network, LENGTH(ref), ref) private static final Comparator RELATION_ORDERING = Comparator .comparingInt( @@ -658,7 +656,8 @@ public void process(Tables.OsmHighwayPolygon element, FeatureCollector features) } } - private List postProcessItems(int zoom, List items, double tolerance) { + @Override + public List postProcess(int zoom, List items) { double minLength = coalesce(MIN_LENGTH.apply(zoom), 0).doubleValue(); // don't merge road segments with oneway tag @@ -671,7 +670,8 @@ private List postProcessItems(int zoom, List postProcessItems(int zoom, List postProcessAllOrNonFerry(int zoom, List items) { - // TODO: use same tolerance as for ferries (see tolerances in OMT `transportation/mapping.yaml`), hence no need to split ferries from the rest in postProcess() - return postProcessItems(zoom, items, config.tolerance(zoom)); - } - - private List postProcessFerry(int zoom, List items) { - return postProcessItems(zoom, items, FERRY_TOLERANCE); - } - - @Override - public List postProcess(int zoom, List items) { - if (zoom < 4 || zoom > 10) { - return postProcessAllOrNonFerry(zoom, items); - } else { - // ferries at Z4-Z10 need different treatment - List ferryItems = new ArrayList<>(); - List otherItems = new ArrayList<>(); - for (var item : items) { - if (FieldValues.CLASS_FERRY.equals(item.attrs().get(Fields.CLASS))) { - ferryItems.add(item); - } else { - otherItems.add(item); - } - } - var result = postProcessFerry(zoom, ferryItems); - result.addAll(postProcessAllOrNonFerry(zoom, otherItems)); - return result; - } - } - enum RouteNetwork { US_INTERSTATE("us-interstate"),