Adding bus stops to OSM
by multimob — written on 2022-01-25
Stops are the main component of a public transport system. Getting stops on the map is an essential task for mappers.
Who came first, the egg or the chicken? The bus route or the bus stop?
For OSM, it looks like starting with the stops is a better option.
Definining what a bus stop is
First clarification required here: on a typical road, buses will travel in both directions, with one stop post on each side of the road.
Even though the name is the same in both directions, for OSM we must consider them to be two different stops. PT operators will typically assign them a name but assign them a unique identifier. In the most common situation, there will be one node on each side of the road. You can locate it on the stop post itself. If you cannot locate it exactly, make sure you get the closest possible location, as long at is is clear.
Required tags are highway=bus_stop
+ public_transport=platform
+ bus=yes
. And of course name
to put its name. When you are done, the map will look like this.
Additional tags
There are many more tags, they will be covered in other articles.
Here are the more important ones:
network
: This is a short text string that can be used to group all the stops within the same network. This is used to query the database. The S-Bahn in a city can have this. There is a large potential overlap with the operator’s name. However, if several companies operate in the same places, it can make sense to say that they all operate the same "network".operator
: The name of the company running the service. In Belgium, it will be De Lijn, STIB/MIVB and TEC, which is how the network is "branded" to the passengers, even when some routes are operated by private contractors.ref
: The unique identifier for the stop. In Belgium, it is always used with the operator or network name as a suffix, e.g.ref:De_Lijn
.route_ref
: A text string containing the list of routes that serve this stop. Though it might look like a useless tag, because this information can be computed from the database—select all the relations that contain this stop—it is a very useful tag for mappers, to check missing routes.not_served_by
: A rare tag but we spotted it on some places. It works like a mirror ofroute_ref
, also with a list of routes. Used in situations where there is a stop and there is a bus route on the road along this stop and in the same direction of travel… but the bus route does not serve this stop. Our guess is that it works to alert mappers not to add the stop to the relation of those routes. Probably very useful near major junctions or bus stations with many stops.zone
: The fare zone. In Belgium, it is always used with the operator or network name as a suffix, e.g.zone:De_Lijn
.
A bus stop is a place where passengers can board or alight from a bus. The most typical situation has one stop on each side of the road, i.e. one per direction. In most cases, they will have the same name but they are considered as two bus stops for OSM.
Where to put it
The simplest case is as such: create a node, locate it exactly where you see the stop pole along the sidewalk.
Tags
Mandatory tags
Required tags are highway=bus_stop
+ public_transport=platform
+ bus=yes
.
What’s in a name
In most countries, bus stops will have a name. The name is the public name given by the operator. Make sure to spell it correctly.
This will be discussed in a future post.
Operator and network
operator
and network
are standard text strings. Some care must be applied here: people will always query the OSM database and you can group all the stops belonging to the same network. This is why those must always be written in the same manner. There are conventions, e.g. the national railway company is known as NMBS in Flanders and SNCB in Wallonia but it is the same company, therefore we will write operator=NMBS/SNCB
on all railway stations in Belgium, and the same text string will be used across the country. This is how we make sure we can easily query all of them at once.
March 2023 update: There is no article so far explaining how TEC subnet work but this article about the network tag can be useful.
Reference code
Each stop has a unique identifier. This identifier is provided by the operator, it can never be guessed.
That stop id can be found on government portals or various open data feed (such as GTFS); alternatively they might be guessed by scraping the website: find the URL giving (real-time) information about a stop, some part of the URL might be that code. Finally, the stop code could be obtained by looking at printed timetables or on stop signs themselves, as it will be usually printed in small characters somewhere.
This id is stored as ref
in OSM. Some networks use a more sophisticated approach. In Belgium, we use ref:De_Lijn
for De Lijn stops, ref:STIB_MIVB
for STIB/MIVB and ref:TEC?
for TEC (where ? is one out of 6 possible choices, as there are 6 sub-networks); this is to avoid ambiguity for stops that are operated by several companies.
De Lijn uses a 5-digit number, the first digit gives the province.
STIB/MIVB uses a 4-digit number and sometimes an additional letter. When a stop is renamed or moved, the number will change, though it looks like in recent times only the additional letter is incremented (1418A becomes 1418B).
TEC uses a really convoluted system: in many provinces the character string is made of 3 parts: B stands for Brabant wallon province, "bou" will mean that the stop is in Bousval, "rel" will be a short name for "Au Relais", and stops with the same name will be numbered starting with 1, therefore the stop code will be Bbourel1. TECB, TECC and TECL use this system. TECH uses a more complicated system: the province is split into sectors, stop codes start with H1, H2 or more, then letters for the town name, numbers for the stop name, and stops with the same name will be numbered starting with a, therefore the stop code will be H1bx105a for Baisieux Cimetière (H for Hainaut province, zone 1, bx for Baisieux, 105 is the stop number and "a" is the platform). TECN and TECX use an even more complicated system where town names are written as numbers and stop names as 2-digit letters: X753abb for Dochamps Carrefour (X for Luxembourg province, zone 7, 53 for Dochamps, ab is the stop number and "a" is the platform).
Permalink: https://blog.multimob.be/zzneez5dua.htm