Mechanical Edits/Mateusz Konieczny - bot account/fix descriptive name on cemeteries in Poland

From OpenStreetMap Wiki
Jump to navigation Jump to search

Page content created as advised on Automated_Edits_code_of_conduct#Document_and_discuss_your_plans.

Who

I, Mateusz Konieczny using my bot account

contact

message via OSM I will respond also to PMs to the bot account. In both cases I will be notified about incoming PMs via email and notifications in OSM editors.

What

Removing descriptive names on landuse=cemetery and amenity=grave_yard

Why

Descriptive names repeating tags are useless and should be removed.

Numbers

around 600 objects

How

state before a mechanical edit:

state after a mechanical edit:


Bot source code

Bot is using https://github.com/matkoniecz/osm_bot_abstraction_layer library, this code is GNU GPLv3 licensed

from osm_bot_abstraction_layer.generic_bot_retagging import run_simple_retagging_task

def edit_element(tags):
    if tags.get('amenity') != ("grave_yard") and tags.get('landuse') != ("cemetery"):
        return tags
    if tags.get('name') == ("cmentarz"):
        tags.pop('name', None)
    if tags.get('name') == ("Cmentarz"):
        tags.pop('name', None)
    return tags

def main():
    run_simple_retagging_task(
        max_count_of_elements_in_one_changeset=500,
        objects_to_consider_query="""
[out:xml][timeout:25000];
area[name="Polska"]->.a;
(
  nwr[landuse='cemetery'][name='cmentarz'](area.a);
  nwr[landuse='cemetery'][name='Cmentarz'](area.a);
  nwr[amenity='grave_yard'][name='cmentarz'](area.a);
  nwr[amenity='grave_yard'][name='Cmentarz'](area.a);
);
out body;
>;
out skel qt;
""",
        objects_to_consider_query_storage_file='/media/mateusz/OSM_cache/OSM-cache/overpass/tags_for_retagging_descriptive_cemetery.osm',
        is_in_manual_mode=False,
        changeset_comment='usuwanie nazw opisowych z cmentarzy (name="cmentarz" i name="Cmentarz")',
        discussion_url='https://forum.openstreetmap.org/viewtopic.php?id=70813',
        osm_wiki_documentation_page='https://wiki.openstreetmap.org/wiki/Mechanical_Edits/Mateusz_Konieczny_-_bot_account/fix_descriptive_name_on_cemeteries_in_Poland',
        edit_element_function=edit_element,
    )

main()

Discussion

Approved by Polish OSM community at https://forum.openstreetmap.org/viewtopic.php?id=70813

Repetition

Single run.

Opt-out

Please write at https://forum.openstreetmap.org/viewtopic.php?id=70813 .

Note that in case of opt-out exactly the same edit will be made manually.