Mechanical Edits/Mateusz Konieczny - bot account/moving 'name:botanical'='Platanus × hispanica' to species='Platanus × hispanica' for natural=tree 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.


I, Mateusz Konieczny using my bot account


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.


Replacing name:botanical=Platanus × hispanica by species=Platanus × hispanica for natural=tree in Poland. Objects with different species=* already present will be not modified.


JOSM encourages to make this name, name:botanical=* is considered as deprecated for good reasons, making this change manually is not useful way to use available human time.


Small groups of trees in Poland.


An example:
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 trees it is not expected that any object will force bounding box to be extremely large.

Edits generated by an osmapi based program using .



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


Code is GNU GPLv3 licensed.

from osm_bot_abstraction_layer.generic_bot_retagging import run_simple_retagging_task

def is_element_editable(element):
    if element.get_tag_value('natural') != "tree":
        return False
    if element.get_tag_value('name:botanical') != "Platanus × hispanica":
        return False
    if element.get_tag_value('species') == None:
        return True
    return element.get_tag_value('species') == element.get_tag_value('name:botanical')

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

def main():
        max_count_of_elements_in_one_changeset = 500,
        objects_to_consider_query = """
  node["name:botanical"="Platanus × hispanica"](area.searchArea);
  way["name:botanical"="Platanus × hispanica"](area.searchArea);
  relation["name:botanical"="Platanus × hispanica"](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 = 'migrating name:botanical tag to species tag',
        discussion_url = '',
        osm_wiki_documentation_page = '',
        is_element_editable_checker_function = is_element_editable,
        edit_element_function = edit_element,



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