Changeset 8452 in josm
- Timestamp:
- 2015-06-03T02:25:26+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/TurnrestrictionTest.java
r8378 r8452 178 178 checkIfConnected((Way) via.get(via.size() - 1), toWay, 179 179 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")); 182 185 } 183 186 184 187 private void checkIfConnected(Way previous, Way current, String msg, int code) { 185 188 boolean c; 186 if ( previous.isOneway() != 0 && current.isOneway() != 0) {189 if (isFullOneway(previous) && isFullOneway(current)) { 187 190 // both oneways: end/start node must be equal 188 191 c = previous.lastNode(true).equals(current.firstNode(true)); 189 } else if ( previous.isOneway() != 0) {192 } else if (isFullOneway(previous)) { 190 193 // previous way is oneway: end of previous must be start/end of current 191 194 c = current.isFirstLastNode(previous.lastNode(true)); 192 } else if ( current.isOneway() != 0) {195 } else if (isFullOneway(current)) { 193 196 // current way is oneway: start of current must be start/end of previous 194 197 c = previous.isFirstLastNode(current.firstNode(true));
Note: See TracChangeset
for help on using the changeset viewer.