User:Polyglot/Public transport

From OpenStreetMap Wiki
Jump to navigation Jump to search
Logo. Feature : Public transport
One example for Feature : Public transport
Description
Railways, buses, trams, etc.
Tags

An overview of current public_transport=* (or mass transit) related tagging.

Introduction

Why do we map public transport in OpenStreetMap?

The main role of street maps has generally been to help people navigate when walking, or when using private motor vehicles on the public highway system. Public transport provides an alternative which is often faster, more environmentally sustainable, and sometimes even more convenient.

Unlike with walking and driving, where it's enough for maps to simply describe the street and footpath layout, allowing people to decide their own route and schedule, with public transport, we need to describe the infrastructure (e.g., the train tracks) as well as the services which operate on them (e.g., bus lines, express trains and local trains).

Whilst OpenStreetMap is probably not the place for full timetable information, adding information about public transport infrastructure and services to the map means that we can provide basic routing services. Very few other maps currently do this (although Google Transit is also making improvements in this area).

Discussion of public transport on OSM takes place on the talk-transit mailing list and on Liste Transport in French.

Types of public transport

Public transport comes in various different forms and types. Each type is usually distinguished by the technology and infrastructure it uses. For example, railways use trains running on metal rails, buses use the main road network, and airplanes use the sky …

Some types may blur the boundaries a little. For example, trams are a form of 'light rail' (using lighter-than-normal train vehicles) which typically run on metal rails embedded into public roads (although may also have sections of dedicated track). There might also exist differences in signalling and the priority at intersections (in some cities trams are prioritised by traffic signals.

In some cases a public transport line can change its type. The following pictures show the Badner Bahn from Vienna (Austria) to Baden (near Vienna, Austria), also known as "Lokalbahn" (literally "local train")

The distinctions can be even more subtle. Buses and coaches, for example, both use motor vehicles on the public road network, however coaches tend to be bigger and more comfortable, and used for longer distances (with fewer stops).

Whilst it may be tempting to try and come up with definitions for these different types, ultimately, maps are most useful if they match with people's expectations. So, when choosing which type a particular public transport service falls into, it's generally best to go with whatever the users of that service general understanding of it would be.

Buses

Main article: Buses

Buses, coaches, guided-buses and trolleybuses all operate mainly on the highway (for trams see the Trams section below).

Mapping simple bus stops should be straighforward without hindering the addition of more detail as time goes on. Add a node node on the side of the road where the people wait or where the pole is.

Add a node node next to the road at the location of the bus stop sign or where passengers wait. It gets following tags:

If there is a real, dedicated platform for waiting passengers (usually a different paving, a Kassel kerb or a tactile paving) the platform is mapped as a unclosed way way or an area area. It gets following tags:

Optionally place a node node on the road where the bus stops. The node should have following tags:

If there is a dedicated shelter, this can be mapped as:

KISS principle

The rationale for using platform nodes and adding details only to those:

  • Easy to work with
  • They have 1 set of coordinates, convenient for direct comparison with other datasets
  • Displaying their tags using MapCSS works well, with offsets in diagonal directions (upper right, lower left, etc)
  • 1 single object to add to the route relations.

It is still possible to map the actual platforms as ways or areas in ADDITION to that node.

Mapping the stop and its surroundings/accommodations can be done without limitations, but it's not necessary to transfer all the details (tags) from the node to the way/area and replace the node in the route relations.

The node REPRESENTING the stop keeps fulfilling this function for the lifetime of the stop's 'existence', both for rendering and in the route relations.


Because a bus stop can now consist of multiple objects, it's possible to use a relation with type=public_transport and public_transport=stop_area to connect them, if their relation is not apparent from geometry.

Wires used by trolley buses can be mapped by adding trolley_wire=yes to the highway. The highway=bus_guideway tag should be used for sections of guided busway.

Every transit service (e.g., No. 38) is usually represented as one route master relation containing two or more variant route relations, one for each direction and more if the itinerary is not always the same.

Railways

Main article: Railways

Railway services (mainline, metro, light rail, tram, subway, etc.) all generally operate on metal rails. The main railway infrastructure is defined using railway=*.

The stops of railways (except trams and tram-like light rails) are mapped as a node (some people also use areas) with railway=station or railway=halt. This tag is only used once per station/halt.

Mapping of stop positions and platforms is done similar to buses:

railway=subway_entrance can be used to define entrances to metro stations. Stations of subways are tagged with railway=station, subway=yes and station=subway. The two latter tags are used to indicate that a station is a subway station.

See the wiki pages Tag:railway=station, Tag:railway=halt, Tag:public_transport=stop_position and Tag:public_transport=platform for further informations about the usage of these tags.

Trams

Main article: Trams

Trams are a form of light rail which share their path with the road for some part of their route.

Trams use the railway=tram tag. Avoid using the same way for a tram as being used for the road (highway=*). Otherwise it is not obvious if additional tags are properties of the road or of the tram. For example, maxspeed=30 might mean that the speed limit of the road is 30 kph but it could also mean that the speed limit of the tram is 30 kph if the way is tagged with both highway=* and railway=tram. Also, use one way for each track. This often means two parallel railway ways plus a highway in the middle, where the tram rails share the highway surface. Where the tram tracks don't follow the highway, this allows to follow the curves of the rails in full detail.

See Tag:railway=tram for more details about mapping trams.

railway=station/halt is not used for tram stops, use railway=tram_stop instead. The usage of other tags is similar to railways:

Aircraft

Main article: Aeroways

Flying (in aircraft) has become one of the most prevalent means of long-distance public transport travel. Currently, flight paths aren't included on our map (they're much less physical than roads and rails). However, this mode of transport does use an extensive range of physical on-the-ground infrastructure, including airport terminals, taxiways, runways, and connecting transport services, and all of these features can be added to OSM.

While the map currently largely goes down to a level of detail of showing airport buildings and runways, in the future we may show the location of the individual aircraft 'gates' and the internal layout of airports.

Ferries

Main article: Ferries

The route of a ferry service can be defined using ways tagged with route=ferry. For sections of route across open water such as the sea, lakes and wide rivers a new linear way tagged as route=ferry should be created. For rivers using waterway=river add route=ferry to this way. If the ferry service ends along the length of an existing river then the river's way should be snipped into two at the point where the ferry service terminates. It is not clear how one tags a ferry that crosses a river that is constructed from a single way as both ends of the ferry would be at the same point. It is possible that adding route=ferry to a node on the river may be appropriate, similar to a crossing point on a road.

Places where people and vehicles can access ferry services should use public_transport=platform with ferry=yes and public_transport=stop_position. The earlier-used amenity=ferry_terminal is still in use. The complete route for a ferry can be described using a relation route using route=ferry.

Cable cars

Main article: Aerialway

Cable-cars, drag-lifts and chair-lifts can be modeled using aerialway=*. These can be considered as a form of public transport in that they are shared, operated for fixed times of day at predictable intervals. Some cable cars may operate to a clock-face timetable.

Aerialway stations are often tagged as aerialway=station. You can add public_transport=station, public_transport=stop_position and aerialway=yes.

Service routes

Main article: Relation:route

In addition to modelling the infrastructure on which vehicles operate and the places where people embark and disembark from transit services, it is also useful to model the public transport services themselves. In particular, this makes it possible to provide public transport routing services.

Route relations (itineraries)

A route is a relation relation that describes the physical path taken by the vehicles through the infrastructure by a transit service which is known to the public with a particular reference or name. The relation contains

  • first a list of all stops in the order: platform node 1, platform node 2, … platforms get the role Role platform.
  • The list of stops is followed by an ordered list of connected ways which are used by the vehicle from the starting station to the terminal station. Each variant of the route must have its own relation, forks are not permitted.
Key Value Comment Recommendation
type route This is a route relation. Mandatory
route train / subway / monorail / tram / light_rail / bus / trolleybus / aerialway / ferry Type of public transport vehicle Mandatory
from Name of the station Name of the starting station Recommended
to Name of the station Name of the terminal station Recommended
via Name of the stations Intermediate stops if different variants per direction exist. Add the stations which make the difference between two routes. Recommended if multiple variants exist per direction
name <reference number>: <from> => <to> Human readable description of the route. <reference number> should be the value of ref=*. Examples: Bus 201: Uitikon Waldegg, Bahnhof => Uitikon, Wängi for a bus route or RE 7: Dessau Hbf => Wünstorf-Waldstadt for a train route. If the line has no number in reality, only use the word "bus" for buses or the type of train (e.g., IC, TGV or RE) for trains (e.g., RE Würzburg Hbf => Stuttgart Hbf Recommended
ref Text Reference number which is valid on the whole line; e.g., "RE 7" oder "S 5". recommended if no route_master=* exists, else optional
ref:<abbreviation> Text Reference number of the line which is assigned by a local authority, differs from ref=* and is not in use on the whole line (e.g line through two states, each state uses a different number for the line). Example: ref:VRN=R 85 recommended if no route_master=* exists, else optional
operator Text Name of the operator. There is no consensus whether you should use abbreviations or not. Multiple names are separated by semicolons. recommended if no route_master=* exists, else optional
network Text Name of the network(s) the route belongs to. The names of the German Verkehrsverbünde go into this tag. There is no consensus whether you should use abbreviations or not. Multiple names are separated by semicolons. Recommended
colour Text Colour of the line symbol (English HTML colour name or web colour in hexadecimal form (e.g., #ff00ff) recommended if no route_master=* exists, else optional
service Text Trains only: type of train service. This tag should make distinction between different types of train easier beyond borders in order that users do not have to parse reference numbers.
  • tourism (trains for tourists, often historic vehicles),
  • night (night trains with sleeping cars),
  • car_shuttle (car shuttle trains through tunnels),
  • car (long distance trains with double-deck car carrier),
  • commuter (urban mass transit service, short headways; e.g., S-train),
  • regional (local train),
  • long_distance (long distance trains; e.g., InterCity, EuroCity, InterRegio)
  • high_speed (high speed trains; e.g., ICE, TGV)
Recommended for trains
public_transport:version 1 or 2 Version of the tagging scheme being used. This makes it easier for data consumers to interpret and validate the data. Mandatory if the route follows the PTv2 scheme

route_master relations (lines)

Because the two directions of a route are split up into at least two relations using PTv2, mappers are encouraged to add master route relations. They link the routes of a line with each other. The master route relation has only the tags which are common among all its route relations. It does only contain relations as members, neither nodes nor ways!

Key Value Comment Recommendation
type route_master This is a master route relation. Mandatory
route_master train / subway / monorail / tram / bus / trolleybus / aerialway / ferry Type of public transport vehicle Mandatory
name <reference number>: <from> <=> <to> Human readable description of the route. <reference number> should be the value of ref=*. Examples: Bus 201: Uitikon Waldegg, Bahnhof <=> Uitikon, Wängi for a bus route or RE 7: Dessau Hbf <=> Wünstorf-Waldstadt for a train route. If the line has no number in reality, only use the word "bus" for buses or the type of train (e.g., IC, TGV or RE) for trains (e.g., RE Würzburg Hbf <=> Stuttgart Hbf Recommended
ref Text Reference number which is valid on the whole line; e.g., "RE 7" oder "S 5". Recommended
ref:<abbreviation> Text Reference number of the line which is assigned by a local authority, differs from ref=* and is not in use on the whole line (e.g line through two states, each state uses a different number for the line). Example: ref:VRN=R 85 recommended if the service changes the reference number when crossing the network's border
operator Text Name of the operator. There is no consensus whether you should use abbreviations or not. Multiple names are separated by semicolons. recommended if available
network Text Name of the network(s) the route belongs to. The names of the German Verkehrsverbünde go into this tag. There is no consensus whether you should use abbreviations or not. Multiple names are separated by semicolons. recommended if available
colour Text Colour of the line symbol (English HTML colour name or web colour in hexadecimal form (e.g., #ff00ff) recommended if available
service Text Trains only: type of train service. This tag should make distinction between different types of train easier beyond borders in order that users do not have to parse reference numbers.
  • tourism (trains for tourists, often historic vehicles),
  • night (night trains with sleeping cars),
  • car_shuttle (car shuttle trains through tunnels),
  • car (long distance trains with double-deck car carrier),
  • commuter (urban mass transit service, short headways; e.g., S-train),
  • regional (local train),
  • long_distance (long distance trains; e.g., InterCity, EuroCity, InterRegio)
  • high_speed (high speed trains; e.g., ICE, TGV)
Recommended for trains
public_transport:version 2 Version of the tagging scheme being used. This makes it easier for data consumers to interpret the data. Recommended if the route follows the PTv2 scheme

Members of this relation are

Role Refers to Comment Recommendation
<empty> All route variant/direction relations Mandatory

Toolbox

A very large collection of tools are available around public transport. See AwesomeTransportTools

Maps

There are several people creating specialist public transport maps:

Mailing list

The talk-transit mailing list was created specifically for discussion of public transport related stuff.

A French speaking mailing list is also available.

Public transport by country

Public transport by country:

Imports

See also: Import/Catalogue

List of transit data imports. Good place to start to see how it's been done elsewhere but be sure to follow Import/Guidelines and Automated Edits code of conduct.

Project Location Summary
Import/VTA Transportation California, USA stops
NaPTAN UK stops
Switzerland/DIDOK Switzerland stations
VRS/Haltestellenimport(de) Cologne, Germany stops
Tenerife Bus Transport Import Tenerife, Canary Islands stops & routes
(undocumented: see [1]) Ottawa, Canada stops

GTFS standard

Data conforming to the GTFS standard could be imported using GO-Sync. It appears to have some useful usable functions and promises to be powerful but is still under (slowed) development.

See also

Further reading