Fix incorrectly tagged buildings in Buzău
Context
There are quite a few incorrectly tagged buildings of apartments in the city of Buzău (Romania), using the following scheme:
name=Bloc
addr:housenumber=Bl. XX
addr:housename=Bloc
This is problematic because:
- it uses
name
and addr:housename with a generic value of "Bloc" (meaning "building of apartments" in romanian), against the OSM guidelines (this is from the same category like tagging a river withname=River
) - In Romania, land is divided into plots and these are assigned administrative numbers. So, a building of apartments usually has such an administrative number, which should be tagged in
addr:housenumber
. Additionally, they might have a specific name, like "Bloc B2
", sometimes abbreviated as "Bl. B2
" - the most suitable tag for this would beaddr:housename
. The tagging scheme of the problematic buildings misuses these tags.
Bad Data Sample
way id: 367083653
"addr:city": "Buzău"
"addr:housenumber": "Bl. 169"
"addr:postcode": "120195"
"addr:postcode:source": "Date de la Poșta Română, publicate sub Licența pentru Guvernare Deschisă v1.0 la http://date.gov.ro/organization/posta-romana",
"addr:street": "Strada Independenței"
"building": "yes"
"building:levels": "5"
"name": "Bloc"
way id: 371413568
"addr:city": "Buzău"
"addr:housenumber": "Bloc 18H"
"building": "apartments"
"name": "Bloc"
Proposal
Fix the tagging on these buildings and only on these buildings by:
- Get the building name from
addr:housenumber
and put it intoaddr:housename
(for correctness) and intoname
(so that it's displayed on the map) - Clear the incorrect
addr:housenumber
- Abbreviate any occurences of "Bloc XX" to "Bl. XX" to match the style of the area
Selecting the Data
Using Overpass:
[out:json][timeout:60];
area[name="Buzău"]->.a;
(
way["building"]["name"="Bloc"]["addr:housenumber"~"^Bl(\\.|oc)\\s+[0-9a-zA-Z]+$"](area.a);
);
out body;
>;
out skel qt;
This query selects from the area of the city "Buzău" all the ways which are tagged as a building, having the name of "Bloc" and having addr:housenumber matching the regular expression "^Bl(\\.|oc)\\s+[0-9a-zA-Z]+$
"
Fixing the Data
There are approximatively 400 items to fix.
Data exported from the Overpass API will be processed in Python using the osmapi
package.
All selection criteria will also be implemented in the Python code.
Before operating the changes, a visual diff will be displayed, in the form of "old tags" vs "new tags" for each object.
Changes will be done on small batches of data, confirming them using a website like OsmCha.
Changes will be done using my OSM account https://www.openstreetmap.org/user/alexnder
Future Use
If everything goes well, the fixing can be extended to the whole country, searching for such badly tagged buildings.
Stage 2
More invalid tagging has been found.
- Buildings tagged with
name=Bloc
andaddr:housename=Bloc
, without anaddr:housenumber
. These will have the tags removed (the ones containingaddr:housenumber
will be analyzed sepparately, as they might contain useful data there).
Stage 3
Add building=apartments for all the buildings that were named "Bloc" in the previous fixes, as "bloc" in romanian means building of apartments.
Outcome
Changes have been applied, relevant changesets:
https://www.openstreetmap.org/changeset/142107812
https://www.openstreetmap.org/changeset/142104295
https://www.openstreetmap.org/changeset/142103917
https://www.openstreetmap.org/changeset/142077227