<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Dec 27, 2016 at 3:53 AM, Peter Dobratz <span dir="ltr"><<a href="mailto:peter@dobratz.us" target="_blank">peter@dobratz.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">There's a bit of confusion around this and it took me quite a while playing around with the relation editor in JOSM ("Select Next Gap") to understand how the "forward" and "backward" roles work.<div><br></div><div><a href="https://i.imgur.com/RGV2XOX.png" target="_blank">https://i.imgur.com/RGV2XOX.pn<wbr>g</a><br><div><br></div><div>First, consider how you would create a road route relation for your example if the red segment didn't exist.  Also, for the moment ignore the signed cardinal directions of the route.  In that case, you would arbitrarily chose to start from the left-most or right-most segment in the picture.  If you chose to start with the right-most segment:</div><div><br></div><div>right-most (role: "")</div><div>blue (role: "")</div><div>green (role: "")</div><div>left-most (role: "")</div><div><br></div><div>All of the roles would be empty and you would not need to use the roles "forward" or "backward".</div></div></div></blockquote><div><br></div><div>Assuming you're in a situation that the route starts and ends on single carriageway, or things get complicated on a level that the existing tools </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>Now consider that the red segment exists and you need to indicate that the road route splits in two and then reconverges.  In this case, you would do the following, again starting at the right side of the picture:</div><div><br></div><div>right-most (role: "")</div><div>blue (role: "backward")</div><div>green (role: "backward")</div><div>red (role: "forward")</div><div>left-most (role: "")</div><div><br></div><div>You traverse the segments where the road splits first following the direction of the route and then backtracking to the point where the road splits and then start adding segments with empty roles.  If either blue, green, or red is reversed in direction, then they would need to have the role "backward" instead of "forward", but would still retain the same position in the list (by convention red should not be reversed since it has oneway=yes).</div></div></div></blockquote><div><br></div><div>So far, so good.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>So now consider that you want to change the route to indicate "east" and "west" signed cardinal directions.  </div><div><br></div><div>One idea is to leave the roles as "forward" and "backward" and just add a direction=west tag on the relation object.</div><div><br></div><div>One idea is that "east" and "west" become synonyms for "forward".  First, reverse the direction of blue and green and change their roles to "forward".  Then change the roles to "east" and "west":<br></div><div><br></div><div><div>right-most (role: "")</div><div>blue (role: "west")</div><div>green (role: "west")</div><div>red (role: "east")</div><div>left-most (role: "")</div></div></div></div></blockquote><div><br></div><div>This makes it nearly impossible, on a level for which a relation for a relation traversing a state roughly the size of the ones in the American west can take 12-16 hours of work for someone who is familiar with the route in question AND working with large relations.  Please don't do this, it breaks the editors.  And I don't mean the tools, I mean the actual people editing.  It's extremely discouraging to be rocking along on an edit only to come to a screeching halt just to end up spending the rest of the weekend validating a relation.</div><div><br></div><div>Cardinal directions should only be used on roles for relation members that are themselves relations.  Example:  You have a super relation for a very long highway.  It contains two relations, one for each direction, so the relation roles would be, say, east and west, or north and south, or clockwise and counterclockwise, or (in very rare edge cases) east and north... (I know of only one example of this, though I haven't bothered to re-survey this since it changed highway number to see if the directions changed).  The child relations would have ways as members that are all contiguous with forward/backward as roles, all pointing in the direction of travel.  This is about the only way to get a relation that validates and isn't a completely impossible to maintain situation on JOSM (and it gets even worse on id and potlatch!) on situations that end on a dual carriageway (such as motorways crossing state lines).  You touched on this further down...</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>In this case, it is critical that blue and green are not reversed again.</div><div><br></div><div><br></div><div>Another approach is to create separate route relations for each direction of the route.  In that case, you would have one relation with direction=east:</div><div>left-most (role: "")</div><div>red (role: "")</div><div>right-most (role: "")</div><div><br></div><div>And a separate relation with direction=west</div><div><div>right-most (role: "")</div><div>blue (role: "")</div><div>green (role: "")</div><div>left-most (role: "")</div></div><div><br></div><div>In this case, it will also help to update the name tag of the relation to include "(East)" or "(West)" to more easily tell the route relations apart in the editor.  Also, the relations can be added to a route_master relation (type=route_master  route_master=road).</div></div></div></blockquote><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>Overall, I think it is cleanest to create 2 route relations, 1 for each signed cardinal direction of the route.  You don't have to arbitrarily decide whether to start the route at the eastern or western terminus as each route relation has a natural starting point based on the signed cardinal direction.  You don't have to deal with roles on member Ways, which are very confusing.  You don't have to worry about the direction of each member way either (again in practice many of them will be marked oneway=yes and have the direction following the flow of traffic).</div></div></div></blockquote><div><br></div><div>I'd include forward/backward as the role as a relation that has a direction can only be traversed in one direction.  I would also recommend this method for any route that ends on a dual carriageway on one or both ends.  For routes that end on a singe carriageway at both ends but have medians in the middle, a single relation is easy enough to work with so long as the roles used are empty, forward or backward with NO other values.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>Note that whatever approach you chose, the route relations will often break when the member Ways are split or combined.  Not all OSM editors do the right thing to preserve the contiguousness of the route relations when performing these operations.  When people decide to add lane or speed limit information to the roads that make up the route, they may inadvertently break the route relation.  In the rare case where multiple users are concurrently splitting Ways that belong to the same route relation, the relation usually breaks.</div></div></div></blockquote><div><br></div><div> JOSM does a pretty good job of not breaking relations in the first place for the most part.  Though the suggestions I mentioned above also greatly help in not making it a tremendous pain when it comes time to check a relation.</div></div></div></div>