Ignore:
Timestamp:
2017-07-25T14:37:49+02:00 (7 years ago)
Author:
giackserva
Message:

[pt_assistant] added helper methods

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/utils/RouteUtils.java

    r33453 r33469  
    2020
    2121    private static final String PT_VERSION_TAG = "public_transport:version";
     22    private static final String TAG_ROUTE = "route";
    2223    private RouteUtils() {
    2324        // private constructor for util classes
     
    6970                "tram", "light_rail", "subway", "train"};
    7071
    71         return r.hasTag("route", acceptedRouteTags);
     72        return r.hasTag(TAG_ROUTE, acceptedRouteTags);
    7273    }
    7374
    7475    public static boolean isRoute(Relation r) {
    75         return r.get("route") != null;
     76        return r.get(TAG_ROUTE) != null;
    7677    }
    7778
     
    231232                || way.hasTag("railway", acceptedRailwayTags);
    232233    }
     234
     235    public static boolean isBicycleRoute(Relation r) {
     236        if (r == null) {
     237            return false;
     238        }
     239
     240        return r.hasTag(TAG_ROUTE, "bicycle");
     241    }
     242
     243    public static boolean isFootRoute(Relation r) {
     244        if (r == null) {
     245            return false;
     246        }
     247
     248        return r.hasTag(TAG_ROUTE, "foot", "walking", "hiking");
     249    }
     250
     251    public static boolean isHorseRoute(Relation r) {
     252        if (r == null) {
     253            return false;
     254        }
     255
     256        return r.hasTag(TAG_ROUTE, "horse");
     257    }
    233258}
Note: See TracChangeset for help on using the changeset viewer.