Cloning/copying a relation or route

I’m working on defining a trail and road route for hiking/biking, and there are necessary minor differences between the two modes due to restrictions on biking through various properties/parks. Our group wants to offer URLs for either mode on a website, even though the majority of the way members along both are identical. Right now I have the relation set up with both route paths included, so it’s got ugly loops in it. What I want to do is clone the relation into two, and then eliminate the bike parts from the walking route and vice versa. Is there a way to do that with iD? Do I need JOSM or something? All I want is to point to (almost) the same way members, not duplicate underlying objects. And yes, I need to do some cleanup by minimal splitting of way objects here and there, or creating new ways just for the route, or whatever’s the best way to go at that.

This project had a couple of false starts and some old data needs to be eliminated, but I’ll be damned if I’m going to hand-duplicate the 400+ members in what we have right now. Uploading an identical set of members into a new relationship should be trivial, frankly, and would serve as the right kind of starting point for the necessary two-pronged cleanup. I do not have JOSM or any JRE/JDK installed and would rather not have to grind through all that just to something that seems this basic.

Well I suspect most people wouldn’t consider that “basic”.

In any case if you have an Android phone handy you could do it with Vespucci, see Relation selected - Vespucci Outside of that you could create an OSC file OsmChange - OpenStreetMap Wiki containing the duplication with your fav text editor and load that in to iD (no guarantees that iD won’t barf though).

1 Like

Might try vespucci, I didn’t know about that one. I have a decent tablet to try. Is an “osmchange” or .osc file the same as that XML you get from “download changeset” in the regular website view? I’m happy with text editors to add/drop elements before uploading.

is an “osmchange” or .osc file the same as that XML you get from “download changeset

Yes.

okay, got Vespucci running and configured, now how the heck do I visit and examine a relation? There seems no place to paste in a simple URL or even an object number.

Just go to one of the locations the route is present at and download the data there (naturally you can download specific elements if necessary but it isn’t in this case), then click on a member way and you’ll get the disambiguation menu showing the way and the route(s). Select the route …

See vespucci.io or the on device help for more info.

I do that, and I get like 5 of the members selected and none of the rest. I don’t see how anyone could reasonably download the entire bounding-box worth of this relation or other large ones. I can’t tap or longpress on other segments that I know are in the relation but aren’t fully visible, no disambiguation gets offered.

I want to download ONLY the ENTIRE route/relation by itself and work on it, and/or duplicate offline and build a new one. It is REALLY non-obvious how to go at this in vespucci, from the help or tutorials or anything else.

I’ve gotten reasonably handy with iD, but this thing is completely throwing me so far. I can pull the XML in the browser, can I build a new relation from that and go back to iD to refine it??

You are moving the goal posts a bit, but anyway; as I pointed out in my initial response: select the route relation and create a shallow duplicate, rename it and then you can upload it and continue to work on it in iD or you can continue in Vespucci.

If you just need to replace minor bits you could use the find function to go to that location, download the area and add and remove relation members as required.

Or alternatively download all the relation members (in the property editor members tab) and then use the search for object to go to a specific element and then same procedure as above. This typically all works better with "pan and zoom’ download turned on as you will always will need all the data in the area you are editing to be sure you are not breaking anything.

This is not trivial in JOSM either. I do not know whether in iD or Vespucci. First thing I’d do, split the OSM-ways of the existing relation as is in such a way, so that it will be possible to clone that relation and all left to do is select which ways are part of the old/new relation. Just a quick thought from a JOSM user.

I absolutely would not attempt to do this sort of thing in Vespucci. A mobile phone screen simply does not allow you to do the investigation and modification needed to do anything useful with a route once you have created it. I’ve just tried it with a route relation near me, and there’s basically no UI to verify and edit the members of the resultant route. I’d also suggest that this is not a “problem” with Vespucci, since it’s just not an appropriate tool here.

Personally I’d use JOSM for the “downloading from and updating of OSM” (mainly because of the interactive validation tool built in there), but I suspect I’d use lots of other things to actually edit the route (for example using a text editor to compare two relations and edit as needed).

However, before thinking about cloning a route, I’d tidy up the existing one. Here is an analysis of the current relation. If you click “analyse on map” you get this:

All the blue markers there are the start and end of sections. You’ll want to fix those first before you start creating the “cycle” version. Some are obvious outliers and connectivity issues; you can even fix those using iD**.

** iD’s documentation there is “not great”, but if you search iD’s issue list and previous iD questions here you’ll see some detail of what it can do.

1 Like

What’s that


then? (Random bus route)*

Not to mention that you can build a route from scratch with auto-spliting of ways simply by clicking on ways on the map.

* on a tablet with split screen mode enabled you can click on the member and the map will zoom to the element and you’ll get the property editor for the element. This naturally works on a phone too, but because of the space constraints it probably doesn’t make sense to enable split screen mode, the standard behaviour is simply to show a property editor for the element.

It’s a list of numbers with no geographical context :smiley: .

What the OP here is trying to do is to create a new route that is initially a copy of an existing route, and then editing it so that it is slightly different. Sorry for kicking your puppy, but they won’t be able to use Vespucci on a phone for that. If I look at a way locally that is a member of some relations I see:

Clearly the description “Hiking Route” is not helpful here. Let’s tap on it and see what we get:

That’s at the end of 16 pages of “all the relations that Vespucci has seen recently”, dating back at least 8 days. “Add to relation” just gets me the same 16 pages.

You are trying to do it in the most complicated fashion.

The proper way is:

  • shallow duplicate the relation
  • select the relation
  • select the Add / remove member function
  • follow the route clicking on the elements you want to add / remove
  • when done click the check mark

As the OP indicated that this is a longer route you would probably make the changes in one area, then move to the next, rinse and repeat.

If there’s a longer segment that you have to construct new, select the start of the new segment, select Add to route, select the target route and then just click on one way after each other. They will be automatically split and added in sequence to the route.

I’m not trying to be dense here, but how do I know which one is which?

How do I know which one to add to? In the example above, many of the routes are just labelled as “Hiking Route” or similar.

Have you considered documenting whatever process you are using, button by button, a picture at a time? If I search vespucci.io for “add to relation” I get this page in Catalan which I was not expecting…

The name template for a hiking route using the default preset is

"Hiking route (?{'{name} ' | ''}?{'{ref} ' | ''}?{'{from} - {via} - {to}' | '{from} - {to}' | '{from}' | '{to}' | '#{special:id}'})">

so you typically should get something identifying in the name in the disambiguation menu (which can be scrolled horizontally).

Lets do an example (in general you will want to have Pan and zoom download turned on for this kind of work).

Click on the track in the middle of the screen.

Now you get the disambiguation menu

You can scroll that horizontally if you have multiple similar entries

Select the Hiking route, route elements are now highlighted

We want to change the route to not go up the hill to the left, but go to the south. Select Add / remove member

Clicking on an existing route member will remove it (you can long click it to avoid the modal)

Select Remove Member

Member has been removed

Click on the road going south, you get a modal allowing you to select a role for the element

Select Route segment, the street is now added to the route

Clicking on the check mark will finish the editing and display the property editor for the relation, and you can check connectivity in the members tab.

Now assume you are actually adding a longer diversion, then the best course of action is to remove the members in one go*, and then use Add to route for the diversion itself.

Select the route you want to add to (again this menu is horizontally scrollable)

Click on the road to the south, it’s added to the route

But here we want to turn off to the left

Click on Glärnischstrasse, Hinterweidstrasse is automatically split and Glärnischstrasse is added to the route

and so on.

For completeness sake here are the relevant release notes from back in 2020 15.1 Release notes - Vespucci

* if you know between which road segments you want to delete it may be faster to do this in the members tab in the property editor.

2 Likes