Public Transport V2 - many routes are invalid...
Posted by Warin61 on 7 October 2018 in English. Last updated on 14 October 2018.Looking around using OSMinspector I find many routes are invalid. Green ones are good, the black/grey ones are bad. You can zoom out (but need to zoom back to get the result) and pan around to your bit of the world.
Why are they invalid? And how to ‘fix’ them? In my part of the world they look to be simply taken from V1 to V2 with no processing. And many of them are not ordered sequentially. It is simplest to do the minimum required to obtain a valid V2 route, but what is the minimum? Well .. from my understanding and experimentation the following looks to be required.
A simple Bus Route in OSM Public Transport V2.
The minimum a route relation with;
In the route relation the tags;
- type=route
- route=bus
- public_transport:version=2
Then as members with the role ‘platform’;
Bus stops at the top in sequential order from the start to the finish. You don’t absolutely require all the stops but need the start and finish as a minimum, hopefully you’ll have a few more. These need each to be tagged as a node with the minimum of
- highway=bus_stop
- public_transport=platform
- bus=yes
Ways next;
to show the roads taken, again these must be in sequential order from start to finish. There must be no gaps. No need for roles here, forwards/backwards are not used in V2. The ‘role’ in the relation is left blank.
Desirable;
These are not essential, add them if you want.
The route relation can have tags for
- from=*
- to=*
- name=*
- via=*
- roundtrip=yes/no
- operator=*
- ref=*
As members all the relevant bus stops, or at least most of them. The stops too may have name=, ref= .. too much time required to gather these for me.
Checking:
Use OSMinspector to check your route works to some degree.
Some Australian samples; relation 3550083 and relation 7258397.
If you really need more details then OSM bus routes .. I find it too long and tedious. The minimum works in the vast majority of cases, if you need more then you ‘ll have to read the long detailed text.
A simple Train Route in OSM Public Transport V2.
The minimum a route relation with;
In the route relation the tags;
- type=route
- route=train
- public_transport:version=2
Then as members with the role ‘stop’;
Train stops at the top of the relation in sequential order from the start to the finish. You don’t absolutely require all the stops but need the start and finish as a minimum, hopefully you’ll have a few more. These need to be tagged as a node on the way with the minimum of
- public_transport=stop_position
- train=yes.
Some say these should be at the front of the train, similar to bus stops. Others say these should be in the middle of the train – the average of where passengers get on. I don’t care, neither does the software so it is your choice. I put mine at the front, as that is what was in the OSM wiki when I looked.
Ways next;
to show the tracks taken, again these must be in sequential order from start to finish. There must be no gaps. No need for a ‘role’ in the relation.
Desirable;
These are not essential, add them if you want.
The route relation can have tags for
- from=*
- to=*
- via=*
- name=*
- operator=*
- ref=*
As members, all the relevant train stops, or at least most of them.The stops too may have name=, ref=.
Checking;
Use OSMinspector to check your route works to some degree.
Some Australian samples relation 3780904 (Newcastle to Sydney) and India Pacific, Perth to Sydney
If you really need more details then OSM Train Routes .. I find it too long and tedious. The minimum works in the vast majority of cases, if you need more then you ‘ll have to read the long detailed text.
Notes;
The tag highway=bus_stop predates the public transport version 2 system, it is rendered in a nice way. The public transport version 2 system bus stop tags do not render but are required fore V2. Maybe v3 will make do with only the tag highway=bus_stop, that would make things easier for mappers.