Mass Edit - building:height Cleanup

Current Situation

Currently there are 5635 buildings in Israel tagged with height (source).
869 of those are also tagged with building:height with an identical value to their height tag:

Overpass Turbo Query


query link

Problem

building:height is deprecated for several years now and is hardly supported (only 5 projects according to taginfo).
Most elements were migrated to the modern and supported height tag over the past years.

As shown in the Overpass Turbo query above - I found many elements in IL that have both tags set to the same value. building:height does not add any value and is considered as a duplicate tag of height (for those elements specifically).

Suggested Solution

Mass edit to select all elements that have both height and building:height in Israel, where both hold the same value and remove building:height.

Example

w663542122 modification:

  building=yes
- building:height=72
  building:levels=21
  height=72



This is my first nation-wide mass edit, I’d appreciate any feedback and guidance on how to proceed :)

1 Like

I’m fine with this mass-edit.

As a next step I’d query elements where only building:height present and do the rename.

In the presented query you only get ways and relations, some buildings can be mapped with a single node - worth including.

I’d start with overpass to get full osm data for matching cases, load it to JOSM and manually delete these tags. 800 items doesn’t feels as too heavy for such task, in a worst case can split to smaller areas.

Thank you @yrtimiD for double checking. I’ll make sure to include nodes in the mass-edit.
Migrating the rest of building:heightheight is a possibility. I wasn’t sure whether to suggest it because key migration felt questionable after reading the code of conduct. I guess there won’t be a better possibility to migrate the rest other than this.

The plan sounds solit but a bit too manual - I’ll try and find a way to automate it.

I think I’ll perform the edits tomorrow to allow for more suggestions or objections.

edit: The following query returns no results:

[out:json][timeout:25];
// fetch area “IL” to search in
{{geocodeArea:Israel}}->.searchArea;
// gather results
(
  node["building:height"](area.searchArea);
);
// print results
out geom;

There are 883 elements where the difference between height and building:height is less than 10 cm. I suggest the mass edit will be applied to all of them.

There are also 5 buildings with building:roof and building:height where

height == building:height + building:roof

As far as I understand the roof:height wiki page, their building:height can also be removed.

Perhaps it would also be appropriate to convert 20 buildings with building:height of to use the height tag.

Following a request from @joshnolan, I’m planning to perform the cleanup, as I’ve suggested above:

  1. Remove building:height from elements where the difference between height and building:height is less than 10 cm.
  2. Remove building:height from buildings with building:roof and building:height where height == building:height + building:roof.
  3. Rename the building:height tag to height for buildings with building:height and no height tags.

The planned process is:

  1. Use the above Overpass queries to create .osm file/s.
  2. Use a text editor to delete and replace text as needed.
  3. Add a action="modify" attribute to the XML elements.
  4. Upload the changes using JOSM.
3 Likes

I usually use JOSM too, but it’s worth mentioning the following option for the record:

Level 0 is often very convenient for text-based mass-editing. Level0 - OpenStreetMap Wiki

A powerful combo is copy-pasting from level0 to vscode, using vscode’s multicursor (CTRL+D or CTRL+F2) where needed, and pasting back to level0. The format is friendlier than XML for humans and multi-cursors alike.

1 Like

Done in Changeset: 182347135 | OpenStreetMap

2 Likes