Mechanical Edits/Mateusz Konieczny - bot account/add highway=bus stop tag where only public transport=platform bus=yes is present 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.

There are at multiple ways to record that bus stop exists at a given location. Two of them are:

  1. node with public_transport=platform bus=yes
  2. node with highway=bus_stop (standard and simplest possible method)

Some bus stops in Poland are mapped solely with method (1) and not mapped with method (2). Method (2) is preferred by a Polish community, though currently double mapping using both is considered acceptable.

This automated edit adds highway=bus_stop to such elements to make using OSM data easier and makes data less confusing.


I, Mateusz Konieczny using my bot account


message via OSM I will respond also to PMs to the bot account, though messaging my main account is preferable as I will get notifications in OSM editors.

English and Polish languages are preferable, for other I need to use an automatic translator.


Adding highway=bus_stop where there are bus stops not mapped using this standard method for marking bus stop.

Editing is restricted to Poland.


highway=bus_stop is standard and simple method for marking bus stop, and may be used on the same objects that already have public_transport=platform bus=yes. There is no good reason to not add it and doing this manually would be extremely boring and waste of human mapping time.


  • Editing is limited to nodes with public_transport=platform bus=yes
  • Nodes with nearby highway=bus_stop are ignored
  • To remaining highway=bus_stop is added
  • Elements with highway tag are skipped
  • Each changeset contains a single region to avoid edits spanning across large areas (it is impossible in cases where edited object itself spans very large area, what is not expected in case of editing bus stops)

A theoretical 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 etc


Approved by Polish OSM community at

I started editing and during monitoring but edit I noticed "and if your edit affects a specialist subject, such as oil rigs or public transport which has its own list then you should also discuss your plans on that mailing list." at Automated Edits code of conduct. Sorry for missing that - I stopped editing and submitted


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. may have more up to date code version that what is listed on this page


Please write at .

Source code

I license this code as GNU GPLv3. It is using library.

from osm_bot_abstraction_layer.generic_bot_retagging import run_simple_retagging_task
import osm_bot_abstraction_layer.overpass_downloader as overpass_downloader
from osm_iterator.osm_iterator import Data
import osm_bot_abstraction_layer.world_data as world_data

def edit_element(tags):
    if tags.get('highway') != None:
        return tags
    if tags.get('bus') != ("yes"):
        return tags
    if tags.get('public_transport') != ("platform"):
        return tags
    tags['highway'] = 'bus_stop'
    return tags

def query(area_name):#//[maxsize:4073741824]
  return """
// we want nodes with public_transport=platform bus=yes, without highway=bus_stop
// and without nearby highway=bus_stop
// within specified boundary (as bot edit permission applies to a specific country)

area[name='""" + area_name + """'];



(.incomplete_bus_stop_nodes; - .incomplete_bus_stops_near_possibly_duplicating_correct_ones;);


def storage_path(filename):
  return '/media/mateusz/OSM_cache/OSM-cache/' + filename

def edit_part(area_name):
        objects_to_consider_query= query(area_name),
        changeset_comment='dodawanie highway=bus_stop tam gdzie go brak na podstawie istniejących danych (public_transport=platform bus=yes)',

def main():
    code = "PL"
    admin_level_of_split = 4
    storage_file = storage_path(code+"_area_divisions.osm")
    for area_name in world_data.list_of_area_divisions(code, admin_level_of_split, storage_file):

print(" for manual fixing")