NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I'd like to convert some London cycle routes currently tagged with lcn_ref=*, possibly multivalued, with relations. How can I find all ways belonging to a specific cycle route in London, or possibly UK but not larger area and edit them to add them all to a relation and remove the route number from the lcn_ref tag?

asked 15 Jul '10, 22:41

tko's gravatar image

accept rate: 0%

You'll want to use the xapi and JOSM. First find the bounds you want by opening JOSM, pressing ctrl-shift-D and selecting the area, then going to the "bookmarks" tab and copying the bounding box coordinates at the top. Close the download window (without downloading anything) and hit ctrl-L, then download*%5bbbox=[paste the bounding box here]%5d%5blcn_ref=* . After it loads, hit ctrl-F and find "type:way lcn_ref:[route]" (this may return too many; for example if you search for 2 you'll also get 12 and you'll have to remove those). Now add those ways to a new relation. There's no way I know of to automate the generation of roles.

Consider keeping the lcn_ref tags for redundancy; it's much easier to inadvertently screw up a relation than a tag on a way and much harder to restore the relation if you don't have the way tags as backup.

permanent link

answered 15 Jul '10, 23:18

NE2's gravatar image

accept rate: 9%

edited 15 Jul '10, 23:20


I would just add that you should think very carefully before embarking on this kind of bulk edit. Then stop and think again. Then talk to the community and see if they agree with the change you plan to make. Then just maybe you should start doing the edit.

(16 Jul '10, 13:41) TomH ♦♦

Keeping lcn_ref on the ways is a good point, it can highlight if there's a conflict between the relation and the way tag. But it also means the same information needs to be maintained in two different places; if you don't do it for all new tags it'll slowly lose its meaning.

(17 Jul '10, 12:24) tko

If the area containing the ways isn't too large, it's possible to do this entirely within JOSM:

Start by downloading the area into JOSM. Bring up the search box using Ctrl-F (or the menu item Edit->Search). The search box offers several features - among them is searching for ways only, and searching for substrings in tag values. There is extensive documentation within the search dialog itself on how to use it.

Using the search dialog, you will select all objects in the downloaded data that match the search. Subsequently, you can perform operations on the entire selection, such as editing tags or adding the selected objects to a relation.

permanent link

answered 16 Jul '10, 13:52

Tordanik's gravatar image

accept rate: 35%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 15 Jul '10, 22:41

question was seen: 6,460 times

last updated: 17 Jul '10, 12:24

NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum