JOSM/Plugins/PT Assistant/Mapping Public Transport with JOSM
Mapping Public Transport with JOSM
How to improve and correct mapping of public transport using JOSM's PT_Assistant plugin.
Configuration
Go to Settings (F12)
Expert mode
Set Expert mode in the bottom left corner
MapCSS
Under Map Paint Styles, install Public Transport MapCSS
Plugins
Under plugins, choose Load from list:
The relevance for mapping public transport becomes less for the ones at the bottom of the list.
pt_assistant utilsplugin2 buildings_tools terracer todo Mapillary OpenStreetCam wikipedia tag2link OpeningHoursEditor measurement RoadSigns reverter undelete markseen scripting
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
Downloading data
First let's download some data using Overpass API:
File/Download from Overpass API
[out:xml][timeout:325][bbox:{{bbox}}];
(
(
node["highway"="bus_stop"];
node["public_transport"="platform"]["train"!="yes"]["ferry"!="yes"];
node["public_transport"="stop_position"]["train"!="yes"]["ferry"!="yes"];
);
._;<;
way["highway"="platform"];
way["amenity"="shelter"];
node["amenity"="shelter"];
relation["route"="bus"];
);
(._;>;);
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
[out:xml][timeout:325][bbox:{{bbox}}];
(
(
node["railway"~"station|halt"];
node["public_transport"="platform"]["train"="yes"];
node["public_transport"="stop_position"]["train"="yes"];
);
._;<;
way["railway"="platform"];
way["building"="station"];
way["amenity"="shelter"];
node["amenity"="shelter"];
relation["route"="train"];
);
(._;>;);
out meta;
Validation
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
Zoom in and select the southern stop node.
Let's add the stop's name and a
- public_transport=platform tag.
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.
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.
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
- amenity=shelter
- shelter_type=public_transport applied right away.
I like to reuse a node of the shelter or a platform way, but that's just personal preference.
This is actually a dual carriageway, so use p to split the way and draw two oneway roads.
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.
If there is an actual platform present, you can also add a way or area tagged
Bus stop in Belgium
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.