Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjustment of buffer pixel overrides for better evaluation of MIN_LENGTH for transportation_name #28

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/main/java/org/openmaptiles/layers/TransportationName.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ public class TransportationName implements
.put(9, 8_000)
.put(10, 4_000)
.put(11, 2_000);
private static final ZoomFunction<Number> BUFFER_PIXEL_OVERRIDES =
ZoomFunction.fromMaxZoomThresholds(Map.of(
13, 256,
6, 256
));
private final boolean brunnel;
private final boolean sizeForShield;
private final boolean limitMerge;
Expand Down Expand Up @@ -255,7 +260,7 @@ public void process(Tables.OsmHighwayLinestring element, FeatureCollector featur

FeatureCollector.Feature feature = features.line(LAYER_NAME)
.setBufferPixels(BUFFER_SIZE)
.setBufferPixelOverrides(MIN_LENGTH)
.setBufferPixelOverrides(BUFFER_PIXEL_OVERRIDES)
// TODO abbreviate road names - can't port osml10n because it is AGPL
.putAttrs(OmtLanguageUtils.getNames(element.source().tags(), translations))
.setAttr(Fields.REF, ref)
Expand Down Expand Up @@ -308,7 +313,7 @@ public void process(Tables.OsmAerialwayLinestring element, FeatureCollector feat
if (!nullOrEmpty(element.name())) {
features.line(LAYER_NAME)
.setBufferPixels(BUFFER_SIZE)
.setBufferPixelOverrides(MIN_LENGTH)
.setBufferPixelOverrides(BUFFER_PIXEL_OVERRIDES)
.putAttrs(OmtLanguageUtils.getNames(element.source().tags(), translations))
.setAttr(Fields.CLASS, "aerialway")
.setAttr(Fields.SUBCLASS, element.aerialway())
Expand All @@ -323,7 +328,7 @@ public void process(Tables.OsmShipwayLinestring element, FeatureCollector featur
if (!nullOrEmpty(element.name())) {
features.line(LAYER_NAME)
.setBufferPixels(BUFFER_SIZE)
.setBufferPixelOverrides(MIN_LENGTH)
.setBufferPixelOverrides(BUFFER_PIXEL_OVERRIDES)
.putAttrs(OmtLanguageUtils.getNames(element.source().tags(), translations))
.setAttr(Fields.CLASS, element.shipway())
.setMinPixelSize(0)
Expand Down