OpenStreetMap Forum

The Free Wiki World Map

You are not logged in.

#1 2012-12-08 04:51:54

JOSM: Edit>Search>Replace Selection

I wish to edit the alt_name key of a group of nodes w/ similar alt_name values, such as B*1, B*2, B*3, ... etc.   I want to change the first two characters "B*" to three characters - "B*O", so that my series of names will then have the form: B*O1, B*O2, B*O3, ... etc.

The Edit>Search> Replace Selection would seem to suggest it offers this ability if it works similar to search and replace in Excel and other programs, but I haven't been able to figure out how to do this.

Is it possible to do what I'm seeking?  Either w/   Edit>Search> Replace Selection  .. or some other method?

Thanks for your help!

Jim

Offline

#2 2012-12-08 08:27:15

Polyglot
Senior Member
From: Belgium
Registered: 2011-11-26
Posts: 122

Re: JOSM: Edit>Search>Replace Selection

You can use a regular expression in your search to find all the objects of interest.

To insert one character you would need to use the scripting plugin of JOSM. I can write some Python code that can do that for you.

The other way to go, is to use an XML editor and work on the OSM file directly. In that case it's not enough to change the alt_name key. You also have to add action='modify' for the objects you touch:

<node id='-20031' action='modify' visible='true' lat='50.5023543692732' lon='5.004308791675721'>
    <tag k='highway' v='give_way' />
</node>

If you do that on a lot of objects, it may be seen as a mechanical edit. So you have to make sure to discuss this change with the local community.

Polyglot

Offline

#3 2012-12-08 15:59:55

Re: JOSM: Edit>Search>Replace Selection

Thank you.  That's what I needed to know.

Offline

Board footer

Powered by FluxBB
Hosting sponsored by Oxilion
Report abuse to osm at na1400 dot info