From b3e370190fe04fb2b887de60f00dd2ebee5e925a Mon Sep 17 00:00:00 2001 From: Mike Barry Date: Wed, 27 Nov 2024 08:21:59 -0500 Subject: [PATCH] fix point min size handling --- .../com/onthegomap/planetiler/FeatureCollector.java | 4 ++++ .../onthegomap/planetiler/render/FeatureRenderer.java | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/planetiler-core/src/main/java/com/onthegomap/planetiler/FeatureCollector.java b/planetiler-core/src/main/java/com/onthegomap/planetiler/FeatureCollector.java index 738857267b..3a08cdde4e 100644 --- a/planetiler-core/src/main/java/com/onthegomap/planetiler/FeatureCollector.java +++ b/planetiler-core/src/main/java/com/onthegomap/planetiler/FeatureCollector.java @@ -1123,6 +1123,10 @@ Partial withAttr(String key, Object value) { return rangesWithGeometries; } + public SourceFeature source() { + return source; + } + /** * A builder that can be used to configure linear-scoped attributes for a partial segment of a line feature. diff --git a/planetiler-core/src/main/java/com/onthegomap/planetiler/render/FeatureRenderer.java b/planetiler-core/src/main/java/com/onthegomap/planetiler/render/FeatureRenderer.java index d19d3b405a..f3c889b681 100644 --- a/planetiler-core/src/main/java/com/onthegomap/planetiler/render/FeatureRenderer.java +++ b/planetiler-core/src/main/java/com/onthegomap/planetiler/render/FeatureRenderer.java @@ -86,10 +86,12 @@ public void accept(FeatureCollector.Feature feature) { } else { if (minSize > 0) { if (geometry instanceof Puntal) { - double size = feature.getSourceFeaturePixelSizeAtZoom(zoom); - if (size > 0 && size < minSize) { - // don't emit points if the source feature it came from was too small - continue; + if (!feature.source().isPoint()) { + double size = feature.getSourceFeaturePixelSizeAtZoom(zoom); + if (size < minSize) { + // don't emit points if the source feature it came from was too small + continue; + } } } else if (simpleLineLength >= 0 && simpleLineLength * scale * 256 < minSize) { // skip processing lines that are too short