Skip to content

Commit

Permalink
Merge pull request #48 from govlt/transportation-name-more-merging
Browse files Browse the repository at this point in the history
Exclude brunell from transportation name
  • Loading branch information
vycius authored Apr 15, 2024
2 parents d291536 + 61a2cba commit 138f4a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@
import lt.lrv.basemap.constants.Layer;
import lt.lrv.basemap.constants.Source;
import lt.lrv.basemap.openmaptiles.OpenMapTilesSchema;
import lt.lrv.basemap.utils.LanguageUtils;

import java.util.Arrays;
import java.util.List;

import static com.onthegomap.planetiler.util.LanguageUtils.nullIfEmpty;

public class Transportation implements OpenMapTilesSchema.Transportation, ForwardingProfile.FeaturePostProcessor {

static final List<String> PAVED_VALUES = Arrays.asList("A", "C", "G", "Md");
Expand Down Expand Up @@ -99,7 +96,7 @@ public void addTransportationFeature(String clazz, String subclass, int minZoom,
.setMinPixelSize(0.0)
.setPixelTolerance(0.0);

TransportationName.addFeature(clazz, subclass, brunnel, level, minZoom, sf, features);
TransportationName.addFeature(clazz, subclass, minZoom, sf, features);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,19 @@ public void processFeature(SourceFeature sf, FeatureCollector features) {
// Currently TransportationName processFeature is handled inside Transportation
}

public static void addFeature(String clazz, String subclass, String brunnel, int level, int transportMinZoom, SourceFeature sf, FeatureCollector features) {
public static void addFeature(String clazz, String subclass, int transportMinZoom, SourceFeature sf, FeatureCollector features) {
var name = nullIfEmpty(sf.getString("VARDAS"));
var rawRef = Utils.coalesce(nullIfEmpty(sf.getString("ENUMERIS")), nullIfEmpty(sf.getString("NUMERIS")));

if (Utils.coalesce(name, rawRef) == null) {
return;
}

// brunnel attribute is excluded from road name line features so that tunnel and bridges don't prevent merging!
var feature = features.line(LAYER_NAME)
.setBufferPixels(BUFFER_SIZE)
.setAttr(Fields.CLASS, clazz)
.setAttr(Fields.SUBCLASS, subclass)
.setAttr(Fields.BRUNNEL, brunnel)
.setAttr(Fields.LEVEL, level)
.setMinPixelSize(0.0)
.setPixelTolerance(0.0);

Expand Down

0 comments on commit 138f4a1

Please sign in to comment.