Beginner's guide to route relations?

One of my interests in contributing to OSM is connected to my other passion which is mountain hiking. I would like to contribute by adding and correcting marked hiking routes in Bulgaria, and have made contact with Bulgarski Turisticheski Soyuz (BTS), the Bulgarian member of the European Ramblers Association. Probably the first project I’m going to work on is to update the Bulgarian part of the E8 so that how it is mapped on OSM will be in agreement with how it’s signposted on the ground and how BTS decides its course should be.
However, I find it difficult to get started. I understand that editing route relations is tricky as a wrong edit can easily lead to a mess with the order of ways in the relation. The wiki is not very helpful: Step by step guide - iD is a promising heading, but it’s nearly empty. The wiki also focusses mainly on creating a route relation from scratch, but doesn’t explain how to correct a map error without creating a mess. By this post I’d like to call on experienced route relation editors to write a beginner’s guide that I can get started with.

FYI you can find most of the notes I added while hiking the E8 two weeks ago in this view OpenStreetMap They illustrate some of the edits I’d like to be able to make.

I beg to disagree. After creating thousands of km of routes I find that ID is much more efficient than JOSM for certain tasks. JOSM is a must for repairing and managing routes, not creating them.

Relation type is displayed in iD as a prefix. In your screenshot, the type of relations “Cleveland Way”, “England Coast Path” and “E2” just wasn’t recognized – either it’s a bare relation (type undefined) or something exotic such as superroute. I don’t recall encountering such ones in iD (where I map, at least).

Btw, hovering mouse pointer over entries in the list helpfully highlights members of the selected relation.


What might help is a top-down description of how these things are set up in OSM currently. Taking the E8 as an example, at the very top is this relation.

It’s a relation, with:

  • type=superroute
  • route=hiking
  • network=iwn

It has members for each country that it goes through, one of which is this one for Bulgaria.

It’s worth mentioning at this stage that the top-level superroute has a couple of ways that have been added to it by mistake, possibly because of this issue. This happens pretty regularly - in the UK and Ireland I regularly fish these out of superroute relations and add them to where they are supposed to be (which you can usually figure out by location).

As an example “country” relation I’ll look at the Great Britain one, because it’s probably more typical than the Bulgaria one is.

The Great Britain part of E8 is here. You can see that it’s a member of the top-level relation mentioned earlier, and is composed of other relations. It is also a relation with:

  • type=superroute
  • route=hiking
  • network=iwn

One of the relations that it is made up of is this one. That is part of two relations - European long distance path E8 - part Great Britain (2275549) and Trans Pennine Trail (4139041). I’ve no idea if the Bulgarian situation is similar, but in the UK routes such as E8 run over existing, locally signed routes, and the relevant pieces of these are added to the “E” relations. This route relation (the more local one) is:

  • type=route
  • route=hiking
  • network=rwn

Finally, when we look at the relation’s members we can see actual ways such as here (confusingly there are lots of similarly-named routes here, but you can see that the one we mentioned above is one of them. There are also a couple of nodes (guideposts / route markers), but adding those isn’t universal.

Looking at the Bulgaria part of E8 as it currently is, you can see that it’s made up directly of ways (with a couple of nodes). That’s OK, if that’s the way that it’s signed on the ground - if there’s no “national trail” that it’s following. Relations can have up to around 32,000 members, though for convenience’s sake they’re usually split well before that limit.

Given that, it’d be perfectly OK just to add your new ways to the existing Bulgaria E8 relation. Don’t worry if there are initially gaps, because as more gets surveyed those can be filled in. Don’t worry about the order of ways in the relation - if it’s linear it’s always possible to sort it with Josm later.

The actual process for adding ways to a relation is pretty much what I said above, with the slight caveat that there’s some jiggerypokery that you have to go through with iD if the route is not local to where you are editing yet. The key bit is that you understand how the different relations fit together, and add new ways at the correct (lowest) level.

Hi ! I have guided a full beginner (a route operator) to add route relations with ID, through a series of Telegram messages. I’ll try to find them in my message history.


I added some instructions to that section, along with tips for editing relations more efficiently. I tend to provide too much detail, so apologies in advance. Hopefully someone can help make the guide more intuitive.

iD doesn’t scramble the member order of every route relation, but it is likely to scramble the E8 relation due to this spur, which seems to follow a convention for bundling spurs with the main route relation. I included some tips for mitigating the scrambling, but probably the most reliable workaround would be to create a separate route relation for the spur to keep the main route linear. (Linear routes are expected under the PTv2 scheme and one of the conventions for highway route relations, but modeling recreational routes can differ somewhat because of how they’re signposted on the ground.)

1 Like

I think it is good to switch over to Josm.

Yes, that will be a steep learning curve but the earlier you do it the more you will benefit :wink:

1 Like

In a sense, you’re both right. iD has challenges with relations, such as here:

it’s really not clear what relation you’re adding a way to, because no attributes other than the name are shown - no relation id, or even relation type.

With Josm the process is so convoluted I can’t just provide one screenshot, you have to:

  • download the way
  • download the data around the way
  • rearrange the little windows in Josm to see the relations
  • find the relation you want to add the way to (but note that here id and relation type are shown, which is better than iD)
  • click an unlabelled icon with does “call relation editor for selected relation” (which is a slight misnomer because in Josm the way is selected but the relation is not yet)
  • Click one of the unlabelled buttons at the right-hand side e.g. “add all objects selected in the current dataset after the last member”
  • Click OK

For completeness, the area is here. The Cleveland Way relation that I’d want to add to in this “test” example is this one. That does appear as a “hiking route relation” at the wrong place in the list. It is type=route; route=hiking; natwork=nwn, which is pretty normal for this sort of thing. The thing that appears as “just a relation” is indeed a superrelation (again, in the wrong order) - but in the context of this thread, a superroute is far from exotic!

Edit: Amazingly, there didn’t seem to be a bug for this. I’ve added this one. A related bug for not showing ids is here.

1 Like

Worth adding that in iD you may not be able to split an existing way which is already part of a relation. You have to remove it from the relation, split it and then add it back to the relation (or at least that’s what I do when I have to alter a bus route because the road topology needs correcting). A somewhat error prone process, so if your work is likely to involve this type of change then you might consider using another editor some of the time.

Josm is quite useful just as a tool for just inspecting and analysing relations, for instance locating gaps (particularly as you can download the relation and its members on their own).

I’ve added a bit more info on how editing existing relations is done in iD. It’s not very detailed but it should do the job. Feel free to edit it if you see something that can be improved (or let me know if something is unclear).

1 Like

I’ve made some of the more simple edits to the Bulgarian E8 as proposed in the notes, i.e. moved some of the route from track(s) to path(s). Can someone check my edits? @Dimitar155 ?