Skip to content

How to use way properties in relations? #820

Answered by zerda-ocm
zerda-ocm asked this question in Q&A
Discussion options

You must be logged in to vote

sourceFeature.getTag("highway")
works for me.

public void processAllOsm(SourceFeature sourceFeature, FeatureCollector features) {
    // ignore nodes and ways that should only be treated as polygons
    if (sourceFeature.canBeLine()) {         
      for (var routeInfo : sourceFeature.relationInfo(RouteRelationInfo.class)) {  
        RouteRelationInfo relation = routeInfo.relation();
        String layerName = relation.route + "-route";
        features.line(layerName)
          .setAttr("name", relation.name)
          .setAttr("ref", relation.ref)
          .setAttr("route", relation.route)
          .setAttr("distance", relation.distance)
          .setAttr("osmc:symbol", relation.osm…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@zerda-ocm
Comment options

@bdon
Comment options

@zerda-ocm
Comment options

Answer selected by zerda-ocm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants