JOSM/Plugins/PT Assistant/Mapping Public Transport with JOSM

From OpenStreetMap Wiki
Jump to navigation Jump to search

Mapping Public Transport with JOSM

How to improve and correct mapping of public transport using JOSM's PT_Assistant plugin.


Go to Settings (F12)

Expert mode

Set Expert mode in the bottom left corner


Under Map Paint Styles, install Public Transport MapCSS


Under plugins, choose Load from list:

The relevance for mapping public transport becomes less for the ones at the bottom of the list.


Increase number of proposed tags

Use F12, last vertical tab and search for properties.recently-added-tags

I like to set it to 12 or 15. 5 is a bit too low for convenience.

JOSM cheatsheet

JOSM Keyboard shortcuts cheat sheet.png

Downloading data

First let's download some data using Overpass API:

File/Download from Overpass API

try it yourself in overpass-turbo
out meta;

This query works well for working on bus route relations. It will result in a skeleton of highways sprinkled with stops. For larger areas increase the timeout, but don't go beyond 600.

It's probably better to use it on smaller areas at first. 1 pair of stops, maybe a bus station, before you try downloading a whole city or region. Since everything is interconnected, it's quite hard to keep the changesets small and manageable, as soon as ways are split.

Another query for train lines

try it yourself in overpass-turbo
out meta;


With the PT_Assistant plugin installed, use the validator button with nothing selected.

All the categories prepended with PT: are issues found by the plugin. Ideally all are resolved before uploading.

PT: Route should start and end with a stop_position

Use right mouse button to Zoom to problem. Then press the select button. You will see the route gets highlighted in purple.

The stops get labels based on ref and on their sequence in the route.

Either the order of the stops is wrong, which can be fixed with

  • Tools Sort PT stops

or a stop_position is missing.

You can add one using the new map mode:

  • Add stop_position node

If you add such a node on the first or last way of a route relation, the way is automatically split and only the correct part is kept in the route relations.

If it's a way in the middle of the route relation, a stop_position node is added to the highway, but the way is not split.

The easiest problems to fix are:

PT: Route contains a gap that can be fixed by sorting

As those will resolve all the problems where the ways are not in the right order anymore

A new category is:

PT: route gaps can decrease by sorting members. Further validation will be required

Those fixes don't solve all the problems with the ways sequence. It may also be an indication that this route wasn't converted to the version 2 scheme yet.

PT: Route passes a oneway road in wrong direction

When the fix button is pressed, a route relation editor is opened, with the ways where the route goes against oneway traffic selected. It's thus easy to remove those ways and replace them by another set of ways. Or, it can also happen oneway:bus=no needs to be added to those ways. They are also selected in JOSM's Map view.

Convenient search expressions

To find all the nodes that should be tagged as public_transport=platform:

highway=bus_stop (-public_transport OR public_transport=stop_position) (-child highway OR child highway=footway OR child highway=platform OR child highway=cycleway OR child highway=sidewalk OR child highway=path)

To find all the nodes that should be tagged as public_transport=stop_position:

((highway=bus_stop -public_transport) OR public_transport=platform) (child highway -(child highway=footway OR child highway=platform OR child highway=sidewalk OR child highway=path))

Map a bus stop

Hover over the screenshots for some more info.

Bus stop in New Zealand

Progressively adding more and more detail to a pair of bus stops in Christchurch, New Zealand

We start with 2 nodes tagged

Situation before.

Zoom in and select the southern stop node.

Select it and zoom in a bit

Let's add the stop's name and a

Add the name of the bus stop and a public_transport=platform

We can also add a

  • route_ref=* tag (values are separated by semicolons)

and add the nodes to the appropriate route relations. PT_Assistant shows the values in pink, based on relation membership, the public transport MapCSS style shows the value of the tag. So it becomes possible to compare them.

Add a route_ref tag and add the node to the appropriate route relations. Observe that MapCSS and PT_Assistant show these for comparison

Now select the node on the northern side of the street. If the tags are the same, it's possible to use Shift-R to repeat them on this node.

Start working on the bus stop of the northern side

On this side of the road there is a shelter. Using the buildings_tools plugin, it's easy to draw a rectangle and have the tags

I like to reuse a node of the shelter or a platform way, but that's just personal preference.

Add bus shelter as a closedway using buildings_tools plugin

This is actually a dual carriageway, so use p to split the way and draw two oneway roads.

Split road into dual carriageway

Let's get fancy and add a bus bay

and a

There is no need to copy the stop's details to this stop_position node and there is also no need to add it to the route relations. There isn't even a real need to add the stop_position nodes, except for the first and the last stops. In that case, you can also split the ways there. PT_Assistant will do this for you automatically if you add a stop_position node to a way that is the first or the last in the route relations used by this way.

Add bus_bay=left (left hand traffic) and stop_position nodes on highway. This is entirely optional. Don't repeat the details from the platform node.

If there is an actual platform present, you can also add a way or area tagged

Add platform way if there is a platform.

Follow the KISS principle and don't add stop_position nodes or highway=platform ways to the route relations

Bus stop in Belgium

Adding extra detail to an already mapped bus stop in Belgium

The shelters are not positioned correctly. We have better imagery nowadays

Repositioned the shelter, added a bench inside it

The waste_basket seems to be next to the shelter

It wasn't we were looking in the opposite direction

Adding highway=platform ways, since there are actual platforms

Rerouting the cycleway around the bus stop platforms

Added bus_bay tags

While adding more and more details to the geometry and the objects around the stop, there was no need to change the tags of the pivot object - the highway=bus_stop public_transport=platform node - or transfer them to an other OSM object.

It's still possible to add stop_area relations

The platform node are the members in the route relations. One object per stop. KISS principle

To create the stop_area relation for the other side of the road, it's possible to use copy relation from the relation editor.

Routing helper functionality

  • The validator reports there is a way in the route relation where the bus travels against a oneway restriction.


  • We press the fix button and a relation editor window is opened with the 'offending' way selected.



  • There is, however, more than one way in this sequence, so let's remove some more adjacent ways manually.




  • Start the routing helper.



  • It finds another route relation with the same problem and it proposes this as a solution. (This is actually a bug)
  • Select option 0, so it goes into turn-by-turn mode.


  • Now select option 1



  • We wanted to go to the left, but the way (coloured in white) is not split yet.
  • Use option 8. It can happen that pressing 8 is needed several times, until the correct way is selected.


  • Press 1, to accept the proposed solution. Now the 'originating' way is split and the way that was coloured green is added to the relation.


  • Press 1 again, now the gap between the way coloured in white and the next way in the route relation, after the gap, coloured in gray, is closed.