User:ChillyDL/sandbox/automated edits
site_type to archaeological_site implementation
concept
In a successful voting on the OSM wiki, it has been decided on December 4th, 2022 to replace the tag `site_type` with the tag `archaeological_site`. 100,000+ POI are affected.
As of January 13th, 2023, 75,000 of the occurrences have already been mechanically re-tagged, converting `site_type=` into `archaeological_site=`. It is not clear – at least to me –, if the lot of the OSM data users and renderers have been informed about this change, and if they have had enough time to adapt. At the same time, 45,000 POI are still tagged `site_type=`. Many are not yet re-tagged, and it is not known if and when they will be. 7000+ POI are tagged both, `site_type=` and `archaeological_site=` with identical values. `site_type=` currently has got 332 values, none of which refer to something other than archaeology.
The implementation of the change in tagging could be improved, it has been noted, see e. g. the in the OSM Germany forum.
In a discussion on the OSM forum, I suggested to
- now tag all POIs tagged `site_type=` simultaneously with `archaeological_site=` and vice versa.
I wrote a script that could do this. - in July 2023, remove the `site_type=` in all the POIs simultaneously tagged `archaeological_site=`.
implementation
- run overpass query for POIs with tag archaeological_site NOT with tag site_type, out meta, export to .osm file.
(nwr["archaeological_site"];
-
nwr["site_type"];
);
out meta; - duplicate lines containing archaeological_site and replace archaeological_site with site_type in the original lines, using these regex in Visual Studio Code:
Find: (.*)k="archaeological_site"(.*)
Replace with: $1k="site_type"$2\r?\n$1k="archaeological_site"$2 - run overpass query for POIs with tag site_type NOT with tag archaeological_site, out meta, export to another .osm file.
(nwr["site_type"];
-
nwr["archaeological_site"];
);
out meta; - run script to duplicate lines containing site_type and replace site_type with archaeological_site in the original lines, using these regex in Visual Studio Code:
Find: (.*)k="site_type"(.*)
Replace with: $1k="archaeological_site"$2\r?\n$1k="site_type"$2 - combine both .osm files in JOSM and upload to OSM.
- check upload result for errors or inconsistancies
Pilot on the German state of Mecklenburg-Vorpommern, then production run
Category:Automated edits log]]