[Talk-us] Proposal to change ref format for county roads in Florida from "(x)" to "CR x"

Alan Mintz Alan_Mintz+OSM at Earthlink.Net
Wed Aug 4 18:46:33 BST 2010


At 2010-08-04 05:17, Nathan Edgars II wrote:
>...
>The steps would be to download a XAPI query of ref=* for Florida and
>then to use regular expressions to change the refs. I'm not quite sure
>how to do the latter; JOSM doesn't seem to have a find-replace
>function. Does anyone have experience with this sort of replacement
>and can offer advice?

Yes, a find/replace in JOSM would be cool.

I've written perl scripts in the past, but these ad-hoc changes I've done 
as follows:

1. As you said, download to a file using XAPI. Save a backup copy of the 
file, too.

2. Open the file in JOSM and search for the regex that identifies the 
objects that you will change. Add some tag to them (e.g. foo=bar). This is 
done to add the action=modify descriptor to them. Save the file and close it.

3. Open the file in a text editor capable of regex replacements (e.g. 
TextPad). Search/replace your desired change. The count should match that 
in step 2. Save and close the file.

4. Open the file again in JOSM. Search for foo=bar. You should get the same 
number as in step 2. Look at your tag changes in those objects one last 
time. Remove the foo=bar tag from them. Upload (note the number of changes, 
which should again match step 2) with a meaningful changeset comment. Save 
the file and close.

--
Alan Mintz <Alan_Mintz+OSM at Earthlink.net>




More information about the Talk-us mailing list