May 27, 2013, 7:37am
I wish to edit the name key of a group of nodes to fix typos and normalize data. For instance, I want to change the first character of names places starting with "El " to "el ".
Currently I have a good filter rule in JOSM, so I can edit each node by hand easilly. But I would be easier selecting all desired nodes and replacing "El " to "el " with a single click. There are many typos in many nodes.
Is it possible to do what I’m seeking?
Thanks for your help!
May 27, 2013, 8:21am
What you want to do is possible after you install the scripting plugin. Let me know if you want an example in Python.
May 27, 2013, 8:36am
Thanks for quick reply,
yes, please provide me a sample basic script. Days ago I installed script plugin, but I’m unable to achieve nothing usefull.
Iterate in each node/way/relation in user’s current selection
If name match a regex ("El "), replace name with regex (s/^El /el /).
May 27, 2013, 10:13am
First of all, you have to install Jython and tell the scripting plugin where to find its executable.
This is probably more than you bargained for:
You’ll have to remove a lot for your purpose, but it’s all there; iterating over objects in the selection, regular expressions. I hope it can inspire you.
May 27, 2013, 8:26pm
Thanks! I’ve created a simple proof-of-concept script,
Now I’m dealing with undo-feature.