Changeset 33728 in osm for applications


Ignore:
Timestamp:
2017-10-22T17:02:03+02:00 (7 years ago)
Author:
polyglot
Message:

Add method to test for suitability for bicycles

File:
1 edited

Legend:

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

    r33727 r33728  
    272272    }
    273273
     274
     275    /**
     276     * Checks if this way is suitable for bicycles
     277     * @param way way
     278     * @return {@code true} if this way is suitable for bicycles
     279     */
     280    public static boolean isWaySuitableForBicycle(Way way) {
     281
     282        return way.hasTag("highway", "cycleway")
     283                || !(way.hasKey("highway", "motorway")
     284                  || way.hasKey("bicycle", "no")
     285                  || way.hasKey("bicycle", "use_sidepath"));
     286    }
     287
    274288    public static boolean isFootRoute(Relation r) {
    275289        if (r == null) {
Note: See TracChangeset for help on using the changeset viewer.