New on waymarkedtrails: relation roles
Posted by lonvia on 6 March 2025 in English. Last updated on 8 March 2025.I’ve just rolled out some updates for waymarkedtrails, the website for browsing route relations. The most notable improvement is that waymarkedtrails is finally able to understand member roles in route relations. This post gives a quick overview of what works and what doesn’t and what has changed with in the route views.
Forward/backward roles
The first group of roles handled specially are forward
and backward
roles which indicate that the route follows the given way only in the direction of the way or in counterflow. These oneway sections are now shown when details of a route are displayed:
Waymarkedtrails will internally merge forward and backward sections into split sections and count them only once when computing the length of the route. However, this only works, when all ways of such a spilt section appear together in the relation and follow the order of the route. (See also the notes on ordering below.)
Roundabouts
Roundabouts are a special form of split section. They may be mapped as a single closed way with a special junction=roundabout
tag and then put into a route relation as a whole without any further role. waymarkedtrails can detect these roundabouts and will automatically split them. This works correctly, even when the roundabout has an approach that has been split into oneways, like here:
However, it works only as long as the roundabout remains in one piece. If, for whatever reason, you split the roundabout way, then you must add each section with the appropriate forward
/backward
role or waymarkedtrails will signal an error.
Other roles
The split sections and ways without a role (or role main
) together make up the main route of the route relation. All other ways are considered appendixes of one form of another. These are split into two groups: ways with an alternative
role are shown with a dashed line in the route view:
All other role types are shown with a dotted line:
You can also see in the screenshots that the display of the ‘mapped length’ has changed slightly. The number now refers to the main route only. Any appendixes are listed separately by their function. This should give you a very quick overview over what kind of roles are used in the relation.
Note: waymarkedtrails still ignores all node members of the relation and makes the blanket assumption that all ways in the relation are part of the route. No exceptions for special roles are made.
Route Order
Some functions of waymarkedtrails need the route to be properly ordered. This affects in particular the elevation profile and the GPX export. Waymarkedtrails has a long-standing policy that it will only sort a route if it can be made strictly linear. Otherwise it will leave the route in the order in which it finds the members in the relation. This policy remains largely in place with two changes that make it more likely that waymarkedtrails can sort a route:
- appendix ways (those with roles other than
forward
,backward
andmain
) are no longer considered for ordering forward
andbackward
sections no longer destroy linearity provided that waymarkedtrails can create a proper split section for them (see above)
Rule of thumb: if JOSM shows a route is whole, then waymarkedtrails will be happy with the route as well.
Gardening your route relations
To make it easier for you to keep your relations whole and healthy, the route list gives you now a hint about the order state of a route:
A green check mark means the route is sorted and linear, all is well. The red double arrow signals that the route is perfectly linear but the route members themselves are not sorted. If member order doesn’t matter to you, then just leave it. The red cross signals a problem with the route. To learn more about where exactly the issues are, click on the route and then open the ‘Analyze relation’ tab at the bottom of the window. waymarkedtrails will add red dots where there are gaps in the relation:
Zoom into the points to find the issue. It usually is a little gap or extruding section. Cycling routes in particular have often issues with the role assignment, especially with forward
and backward
roles.
Where to go from here
Having fully annotated routes with split sections and appendixes will make a few other improvements possible, in particular, a more clever GPX download where you can choose which direction and role types to include. This has to wait until later. For now I wanted to push this first version in the hope that it is useful to help you maintain and improve the state of route relations.
Discussion
Comment from Ze0zohk1 on 6 March 2025 at 20:01
Thank you very much for those improvements! I am really looking forward to more of those improvements. Thanks for all your work :-)
Comment from ivanbranco on 7 March 2025 at 10:24
How often is the gardening checks updated? e.g. with osm.org/relation/1471008 a red X is shown, but https://ra.osmsurround.org/ tells me there are no problems with the relation (I fixed some gaps 6 days ago). If the members are not ordered shouldn’t it be the <-> red symbol?
Comment from MDe on 7 March 2025 at 15:01
Cool…
Comment from lonvia on 8 March 2025 at 09:14
@ivanbranco The “gardening checks” are always up to date, i.e. correspond to the update date shown in the upper left corner.
There is a tiny appendix in that relation around here: osm.org/relation/1471008#map=19/45.323679/8.404741 I believe that the relation analyser is more forgiving than waymarkedtrails with those kinds of errors. I found the problem by loading the relation into josm and then sort it in the relation editor. Afterwards you can quickly scroll through the list and find the red gaps in the last column.
The “Analyse relation” view is currently of limited use when the relation isn’t sorted. Let me think about bringing back different colors for the open connections depending on how many ways end there. This should make it easier to spot problematic points in unsorted routes.
Comment from Hedaja on 23 March 2025 at 17:49
Awesome changes. Thank you