Changeset 8452 in josm


Ignore:
Timestamp:
2015-06-03T02:25:26+02:00 (6 years ago)
Author:
Don-vip
Message:

fix #11503 - support oneway:bicycle in turn restriction test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/TurnrestrictionTest.java

    r8378 r8452  
    178178            checkIfConnected((Way) via.get(via.size() - 1), toWay,
    179179                    tr("The last \"via\" and the \"to\" way are not connected."), TO_VIA_WAY);
    180 
    181         }
     180        }
     181    }
     182
     183    private static boolean isFullOneway(Way w) {
     184        return w.isOneway() != 0 && !"no".equals(w.get("oneway:bicycle"));
    182185    }
    183186
    184187    private void checkIfConnected(Way previous, Way current, String msg, int code) {
    185188        boolean c;
    186         if (previous.isOneway() != 0 && current.isOneway() != 0) {
     189        if (isFullOneway(previous) && isFullOneway(current)) {
    187190            // both oneways: end/start node must be equal
    188191            c = previous.lastNode(true).equals(current.firstNode(true));
    189         } else if (previous.isOneway() != 0) {
     192        } else if (isFullOneway(previous)) {
    190193            // previous way is oneway: end of previous must be start/end of current
    191194            c = current.isFirstLastNode(previous.lastNode(true));
    192         } else if (current.isOneway() != 0) {
     195        } else if (isFullOneway(current)) {
    193196            // current way is oneway: start of current must be start/end of previous
    194197            c = previous.isFirstLastNode(current.firstNode(true));
Note: See TracChangeset for help on using the changeset viewer.