Mechanical Edits/Mateusz Konieczny - bot account/Orlen in Poland
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
Apply brand=Orlen and name=Orlen where it clearly should be.
Why
In Poland amenity=fuel with name=Orlen is definitely also brand=Orlen
In Poland amenity=fuel with name=PKN Orlen is definitely also brand=Orlen and its name should be name=Orlen (they renamed the company)
Numbers
Depends on how many new descriptive names appear - depends on editing activity in OSM.
How
- Editing is limited to objects with amenity=fuel tag.
- Editing is limited to objects with name=Orlen or name=PKN Orlen tag
- Editing is limited to objects with brand=Orlen or brand=PKN Orlen tag or no brand=*
- Editing is limited to objects in Poland.
state before a mechanical edit:
state after a mechanical edit:
Not adding brand:wikidata=* and brand:wikipedia=* is intentional - as these tags were widely added without actual human review they add nothing to what is expressed by brand=* and object location.
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') != ("fuel"): return tags if tags.get('name') in ["Orlen", "PKN Orlen"]: if tags.get('brand') in [None, "PKN Orlen"]: tags["brand"] = "Orlen" tags["name"] = "Orlen" return tags def main(): query=""" [out:xml][timeout:1800]; area[name="Polska"]->.a; ( nwr[amenity='fuel'][name='Orlen']["brand"!~".*"](area.a); nwr[amenity='fuel'][name='PKN Orlen']["brand"!~".*"](area.a); nwr[amenity='fuel'][name='PKN Orlen']["brand"="PKN Orlen"](area.a); ); out body; >; out skel qt; """ run_simple_retagging_task( max_count_of_elements_in_one_changeset=500, objects_to_consider_query=query, cache_folder_filepath='/media/mateusz/OSM_cache/osm_bot_cache', is_in_manual_mode=False, changeset_comment='harmonizacja tagowania stacji Orlenu', discussion_url='https://wiki.openstreetmap.org/wiki/Mechanical_Edits/Mateusz_Konieczny_-_bot_account/Orlen_in_Poland', osm_wiki_documentation_page='https://wiki.openstreetmap.org/wiki/Mechanical_Edits/Mateusz_Konieczny_-_bot_account/Orlen_in_Poland', edit_element_function=edit_element, ) main()
Discussion
Approved by Polish OSM community at https://community.openstreetmap.org/t/propozycja-automatycznej-edycji-brand-orlen-na-stacjach-orlenu/108698 (there were requests for further bot edit, but these changes were considered as a good idea)
Note that adding as brand:wikidata=* was proposed to be done as part of this bot edit, but as this tag adds no useful info (brand=* and location of POI is enough to replace it - it is anyway being added in what is effectively bot edits so brand:wikidata=* adds no useful info).
Repetition
This is reoccurring edit and may be made as soon as new matching elements appear. At this moment triggering new edit requires human intervention so exact schedule is not predictable and bot may stop running at any moment.
This can change in a future. If bot is abandoned and does not run, feel free to ping me. If I am unable to run it any more feel free to use my code. Note that it may require going through bot approval process again and that code is on specific license.
https://codeberg.org/matkoniecz/OpenStreetMap_cleanup_scripts/src/branch/master/recurrent_bot_edits may have more up to date code version that what is listed on this page
Opt-out
Please write at forum topic where it was discussed .
Note that in case of opt-out exactly the same edit will be made manually.