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

I have to confess: many years ago I made a noob tagging mistake - one that I have been perpetuating ever since! Shoot me now ;-)

I started custom tagging buildings around my university campus with 'building_number', corresponding to our organisational numbering of buildings. I realised much later, that I should have done something with a namespace that at least made some sense.

I'm thinking 'unimelb' (our main domain name) would be an appropriate namespace that we may reuse in other ways, and therefore the tag I'd use would be unimelb:building_number or something like that. Is this making sense so far? Is this the right way to go about it?

My next problem is, that there are now quite a few of these buildings, and being a point and click type of person, it represents quite a bit of work to change - a bit haphazard, too. I'm sure there must be a way of making a bulk change using some sort of command line/API magic. Am I right? Should I attempt this, or should I talk to someone with stronger query fu?

I have been tagging the buildings concerned (about 95% completed) with operator="University of Melbourne", partly so they're easier to isolate and style in Tilemill, but I figure it might also make it easier to perform the change I'm intending.

Any input/suggestions/help gratefully received!

asked 07 Feb '14, 03:34

woowoowoo's gravatar image

woowoowoo
1906714
accept rate: 0%

edited 08 Feb '14, 02:42

he_the_great's gravatar image

he_the_great
1.2k61423


My answer is similar to jgpacker's, but can be done more quickly and all within JOSM.

  • Download the area containing all of the buildings in JOSM
  • Search (Ctrl+F) for building_number. This will select all objects in the area you downloaded that have this tag
  • Scan down the list of selected objects to make sure it contains only the things you want to change, namely the university buildings you tagged with building_number
  • In the tag box at the top right, it will have a line for the tag building_number with the value < different >
  • Click edit for this tag and change the key field from building_number to whatever new key you want to use, like ref, but don't touch the value field, leaving it as < different >

What this will do is retain the respective value field for each of the objects, but change the key for all of them. For example, building_number=100 would become ref=100. This saves having to edit each one individually or edit an .OSM file.

permanent link

answered 07 Feb '14, 17:07

alester's gravatar image

alester
6.6k266100
accept rate: 28%

1

Oh, I was under the impression this was possible, but I couldn't test it at that time. I was going to forget about this anyway, so thanks.

(07 Feb '14, 17:18) jgpacker
1

yep - this is a winner. discovered it myself and ran a few small tests very successfully.

Big thanks to all :-)

(07 Feb '14, 21:33) woowoowoo

In JOSM, you can simply search(ctrl+f) for building_number or building_number:* and you will find them. That's probably the first thing you want to do to verify that only the buildings you added that actually have this tag.

If you want to automate this process, you may do the following:

After downloading the university via JOSM, save it as a .osm file. Close JOSM and open the .osm file in a text editor, and use the text editor's "replace all" functionality on building_number to the tag you desire to use. Then open this file in JOSM, download the data from OpenStreetMap, and merge the layers of the file with the OSM Data Layer. Send Changes.

In this case, you probably want to use ref=* or ref:unimelb=* instead of unimelb:building_number=*.

permanent link
This answer is marked "community wiki".

answered 07 Feb '14, 11:11

jgpacker's gravatar image

jgpacker
23651019
accept rate: 10%

edited 07 Feb '14, 11:34

1

I've found the JOSM TODO_list plugin useful for working down a list:

http://wiki.openstreetmap.org/wiki/JOSM/Plugins/TODO_list

(07 Feb '14, 11:26) SomeoneElse ♦

I believe the JOSM editor has functionality to find downloaded items with a specific tag.

I don't believe there is anything which well help you bulk modify these tags. The OSM community has had strong reservations about bulk modifications, so tools are written without this capability. I'd love to be shown wrong though.

permanent link

answered 07 Feb '14, 04:27

he_the_great's gravatar image

he_the_great
1.2k61423
accept rate: 14%

1

hmm - yes, I'm aware of the 'dangers' of bulk processing, but are there not bots which do automated processing? scuse my ignorance on this.

In any case, is my thinking around the right way to tag these correct? - with the unimelb namespace?

(07 Feb '14, 05:17) woowoowoo
2

There are bots, but these must go through long formal review or risk changes being reverted. I don't have an answer for how to tag your buildings (there are questions about tagging university buildings somewhere).

(07 Feb '14, 05:34) he_the_great

ahh - that makes sense. To be honest, I've found JOSM too clunky in the past, but was just having another look at it, and it's improved markedly since my last encounter. Seems to make the process less painful, so I guess I'll be going that way. Thanks for your help.

(07 Feb '14, 05:38) woowoowoo
1

If you really want to get risky, save the downloaded area as a OSM file which is just a XML text file. Then use a text editor to find and change the key name on your custom key. Fire JOSM back up, load the OSM file, verify your changes and then up load.

(07 Feb '14, 06:14) n76

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×930
×293
×202
×191
×10

question asked: 07 Feb '14, 03:34

question was seen: 4,378 times

last updated: 08 Feb '14, 02:42

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