Mechanical Edits/Mateusz Konieczny - bot account/removing 'name:botanical' tag where it duplicates 'species' tag 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 name:botanical=* where it duplicates species=*.

Why

Moving name:botanical=* to species=* and removing name:botanical=* is recommended by JOSM. Doing it manually where it gives no benefit is a waste of time, it is better use mapping time for something more useful.

Numbers

Less than 450

How

An example ( https://www.openstreetmap.org/node/3256064499/history ):
state before a mechanical edit:

state after a mechanical edit:


Changeset would be described and tagged with tags that mark it as automatic, provide link to discussion approving edit, link repository with source code etc. It would include at least


Changeset split into small areas to avoid continent-sized bounding boxes. As this tag is on buildings it is not expected that any object will force bounding box to be extremely large.

Edits generated by an osmapi based program using https://github.com/matkoniecz/osm_bot_abstraction_layer .

Discussion

https://forum.openstreetmap.org/viewtopic.php?id=64293

Repetition

Redoing this edit in the future would be treated as a new mechanical edit with a new approval process.

Opt-out

Please comment in the discussion thread (see #Discussion).


Code

from osm_bot_abstraction_layer.generic_bot_retagging import run_simple_retagging_task

def is_element_editable(element):
    if element.get_tag_value('name:botanical') == None:
        return False
    return element.get_tag_value('species') == element.get_tag_value('name:botanical')

def edit_element(tags):
    tags.pop('name:botanical', None)
    return tags
    # 
    #tags.get('wikipedia') != None
    #tags['wikipedia'] = expected_wikipedia
    #tags.pop('L_KOND_POD', None)

def main():
    run_simple_retagging_task(
        max_count_of_elements_in_one_changeset = 500,
        objects_to_consider_query = """
[out:xml][timeout:25];
area[name='Polska']->.searchArea;
(
  node["name:botanical"](area.searchArea);
  way["name:botanical"](area.searchArea);
  relation["name:botanical"](area.searchArea);
);
out body;
>;
out skel qt;
""",
        objects_to_consider_query_storage_file = '/media/mateusz/5bfa9dfc-ed86-4d19-ac36-78df1060707c/OSM-cache/overpass/tags_for_retagging.osm',
        is_in_manual_mode = False,
        changeset_comment = 'removing unneded name:botanical tag suplicating species tag',
        discussion_url = 'https://forum.openstreetmap.org/viewtopic.php?id=64293',
        osm_wiki_documentation_page = 'https://wiki.openstreetmap.org/wiki/Mechanical_Edits/Mateusz_Konieczny_-_bot_account/removing_%27name:botanical%27_tag_where_it_duplicates_%27species%27_tag_in_Poland',
        is_element_editable_checker_function = is_element_editable,
        edit_element_function = edit_element,
        )

main()