Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationNodeMap.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationNodeMap.java	(revision 16885)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationNodeMap.java	(revision 16886)
@@ -177,17 +177,20 @@
     private Integer popForwardOnewayPart(Integer way) {
         if (onewayMap.ways.containsKey(way)) {
-            for (Node n : onewayMap.ways.get(way)) {
-                Integer i = findAdjacentWay(onewayMap, n);
-                if (i == null) {
-                    continue;
-                }
-
-                lastOnewayNode = processBackwardIfEndOfLoopReached(i);
-                if (lastOnewayNode != null)
-                    return popBackwardOnewayPart(firstOneway);
-
-                deleteWayNode(onewayMap, i, n);
-                return i;
-            }
+            Node exitNode = onewayMap.ways.get(way).iterator().next();
+
+            if (checkIfEndOfLoopReached(exitNode)) {
+                lastOnewayNode = exitNode;
+                return popBackwardOnewayPart(firstOneway);
+            }
+
+            Integer i = deleteAndGetAdjacentNode(onewayMap, exitNode);
+            if (i != null) return i;
+
+            // When our forward route ends in a dead end try to start
+            // the backward route anyway from the split point
+            // (firstOneWay), to support routes with split a split start
+            // or end.
+            lastOnewayNode = exitNode;
+            return popBackwardOnewayPart(firstOneway);
         }
 
@@ -196,15 +199,14 @@
     }
 
-    private Node processBackwardIfEndOfLoopReached(Integer way) { //find if we didn't reach end of the loop (and process backward part)
-        if (onewayReverseMap.ways.containsKey(way)) {
-            for (Node n : onewayReverseMap.ways.get(way)) {
-                if (map.nodes.containsKey(n)
-                        || (onewayMap.nodes.containsKey(n) && onewayMap.nodes.get(n).size() > 1))
-                    return n;
-                if (firstCircular != null && firstCircular == n)
-                    return firstCircular;
-            }
-        }
-        return null;
+    // Check if the given node can be the end of the loop (i.e. it has
+    // an outgoing bidirectional or multiple outgoing oneways, or we
+    // looped back to our first circular node)
+    private boolean checkIfEndOfLoopReached(Node n) {
+        if (map.nodes.containsKey(n)
+                || (onewayMap.nodes.containsKey(n) && onewayMap.nodes.get(n).size() > 1))
+            return true;
+        if (firstCircular != null && firstCircular == n)
+            return true;
+        return false;
     }
 
@@ -267,6 +269,9 @@
         } else {
             done(way);
-        }
-        nw.ways.get(way).remove(n);
+            // For bidirectional ways, remove the entry node, so
+            // subsequent lookups will only return the other node(s) as
+            // valid exit nodes.
+            nw.ways.get(way).remove(n);
+        }
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculator.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculator.java	(revision 16885)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculator.java	(revision 16886)
@@ -146,5 +146,5 @@
 
         if (!wct.linkPrev) {
-            wct.direction = determineDirectionOfFirst(i, m);
+            wct.direction = determineDirectionOfFirst(i, m, false);
             if (RelationSortUtils.isOneway(m)) {
                 wct.isOnewayLoopForwardPart = true;
@@ -218,5 +218,5 @@
     }
 
-    private Direction determineDirectionOfFirst(final int i, final RelationMember m) {
+    private Direction determineDirectionOfFirst(final int i, final RelationMember m, boolean reversed) {
         Direction result = RelationSortUtils.roundaboutType(m);
         if (result != NONE)
@@ -224,5 +224,5 @@
 
         if (RelationSortUtils.isOneway(m)) {
-            if (RelationSortUtils.isBackward(m)) return BACKWARD;
+            if (RelationSortUtils.isBackward(m) != reversed) return BACKWARD;
             else return FORWARD;
         } else { /** guess the direction and see if it fits with the next member */
@@ -248,4 +248,27 @@
             }
 
+            // Support split-start routes. When the current way does
+            // not fit as forward or backward and we have no backward
+            // ways yet (onewayBeginning) and the most recent oneway
+            // head starts a new segment (!linkPrev), instead of
+            // disconnecting the current way, make it the start of the
+            // backward route. To render properly, unset isOnewayHead on
+            // the most recent head (since the current backward way does
+            // no longer start there).
+            if (dirFW == NONE && dirBW == NONE && RelationSortUtils.isOneway(m) && !wct.isOnewayHead) {
+                WayConnectionType prevHead = null;
+                for (int j = i - 1; j >= 0; --j) {
+                    if (con.get(j).isOnewayHead) {
+                        prevHead = con.get(j);
+                        break;
+                    }
+                }
+
+                if (prevHead != null && !prevHead.linkPrev) {
+                    dirBW = determineDirectionOfFirst(i, m, true);
+                    prevHead.isOnewayHead = false;
+                }
+            }
+
             if (dirBW != NONE) {
                 onewayBeginning = false;
@@ -269,12 +292,7 @@
             if (dirFW == NONE && dirBW == NONE) {
                 wct.linkPrev = false;
-                if (RelationSortUtils.isOneway(m)) {
-                    wct.isOnewayHead = true;
-                    lastForwardWay = i-1;
-                    lastBackwardWay = i-1;
-                } else {
-                    lastForwardWay = UNCONNECTED;
-                    lastBackwardWay = UNCONNECTED;
-                }
+                wct.isOnewayHead = true;
+                lastForwardWay = i-1;
+                lastBackwardWay = i-1;
                 onewayBeginning = true;
             }
