|Feature : Railways|
|All forms of transport using metal rails, including mainline services, subways, heritage lines and trams|
There is considerable information about railways, including mainline services, subways, heritage lines and trams in OpenStreetMap, together with details of railway stations, sidings and freight terminals.
Types of railway line
Railway lines should be tagged based on the type of operation. Where tracks are shared between multiple types of service, the more major service should be used (generally the longer distance or heavier line).
Lines are generally assumed to be primarily for use by passenger unless tagged as railway:traffic_mode=freight for freight only lines, usage=military for lines only used by the military, and usage=tourism for lines used only as a tourist attraction.
The electrified=* key, together with frequency=* and voltage=* can be used to specify details of how the track is powered. Use electrified=no if the line is not electrified, electrified=contact_line if it is powered from an overhead wire and electrified=rail if it is powered from a '3rd (or 4th) rail'. For short sections of track used for storage of trains add a service=siding, for tracks within a place used for maintenance of trains use service=yard and for short spur lines leading to an industrial or military facility use service=spur. Add a node with railway=level_crossing for points where a road crosses a railway line at-grade and railway=crossing for a point where pedestrians may cross. The railway=turntable tag is used for turntables. Gauge is specified using gauge=* which should contain nominal width of the track in millimeters (1435 for standard gauge). Buffers are tagged railway=buffer_stop on a node.
When modeling multi-track parallel railway lines in close proximity they can either be modeled as a single way with tracks=*, or as a number of parallel ways. If individual tracks have different tagging requirements (max-speed, electrification, gauge, etc.) then the tracks should be modelled appropriately. The tracks=* tag should be used to record the number of tracks with a default value of
1 being assumed where this is not supplied.
Where a line goes over a bridge the relevant section should be tagged with either bridge=yes for shorter bridges or bridge=viaduct for long bridges and layer=1 or other value as appropriate. Where a track goes through a tunnel it should be tagged with tunnel=yes often at layer=-1. Where the tracks are on ground raised for the purpose use embankment=yes and when in a cutting use cutting=yes. If necessary split the way at the point where the bridge or cutting or whatever starts and ends. Track using embankments and cutting does not normally need a layer tag.
Where a line has a recognised name this can be included in name=*. Sometimes this is entered as the name of the operator=* or owner=*, but if they are known, please use these tags, reserving name=* for the actual name of the line.
|Mainline||railway=rail - Full-sized passenger or freight trains in the standard gauge for the country or state. See also Key:usage to properly distinguish between, for example, usage=main, usage=branch and usage=industrial. (Also, usage=tourism and usage=military).|
|Subway||railway=subway - A large city- to suburban-scale passenger rail service running mostly grade separated (see Wikipedia:rapid transit), often fully and at least partially underground. Overlaps somewhat with "metro" (passenger rail) and/or "rapid transit."|
|Light rail||railway=light_rail - A higher-standard tram system, normally in its own right-of-way with dedicated signalling, but may be "street running," especially in dense, urban/downtown areas.|
|Tram||railway=tram - Trolley rail systems with one/two carriage, usually four-wheeled vehicles, often share roads with cars ("street running").|
|Narrow-gauge||railway=narrow_gauge - Narrow-gauge passenger or freight trains, often tourist/scenic routes. In some regions narrow gauge railways are used for full sized passenger or freight trains service. See the Rhätische Bahn (RhB) and Matterhorn Gotthard Bahn (MGB) in Switzerland as examples for such full featered narrow gauge railways. Use gauge=* to specify in millimeters how small narrow is for this railway.|
|Monorail||railway=monorail - A railway with only a single rail, often inner city and above street level. Also used for monorail-like automated people-mover systems like Miami's Metromover.|
|Preserved||railway=preserved OR railway:preserved=yes + railway=*- A railway running historic trains, usually a tourist attraction.|
|Miniature||railway=miniature - Smaller trains, often at a precise scale of "regular-sized" rail (such as "1/4 scale"), normally operated as a tourist attraction.|
|Funicular||railway=funicular - Cable driven inclined railways.|
Railway ways are commonly members of two types of route relations:
- railway route - a sequence of interconnected, usually contiguous railway ways, often between two major junctions, sometimes including minor branches.
- train route - a route of a train in regular service, including railway ways/routes traveled and stations served.
Stations and stops
- Main article: Railway stations
Please see the main article about station tagging as it is beyond the scope of this guide.
Features in OpenStreetMap may be in a number of states - from planned to abandoned. For railways it is common to use combinations such as railway=disused + disused:railway=rail/light_rail/subway/tram to indicate that the railway is disused and which kind of railway it was. For other railway related features such as railway=station it is suggested (OpenRailwayMap/Tagging#Stations / Stops) to use just the lifecycle prefix such as disused:railway=station.
- Proposed - For features that have a strong likelihood of being constructed. For a proposed railway line tag it with railway=proposed and also proposed=* where * is the type of railway being proposed (rail, subway,light-rail etc). An aspiration on the part of an authority or from an advocacy group which is not funded or approved should not be added.
- Construction - features that are in the process of being constructed with actual work on the ground. For a railway line under construction tag it with railway=construction and also construction=* where * is the type of railway being constructed (rail, subway,light-rail etc). Often this will be a feature that has previously been 'proposed'.
- Operation - the normal situation for most features. No additional tagging needed and the construction tags should be removed. Consider adding a start_date=* tag.
- Preserved - a former mainline railway which is now operated as a tourist attraction. Use railway=preserved, or alternately railway:preserved=yes + railway=*.
- Disused - the feature is still in working order, or could be brought back to working order easily. Use railway=disused.
- Abandoned - The track has been removed and the line may have been reused or left to decay but is still clearly visible, either from the replacement infrastructure, or purely from a line of trees around an original cutting or embankment. Use railway=abandoned. Where it has been reused as a cycle path then add highway=cycleway. Consider adding a end_date=* tag or more specifically a railway:end_date=* tag.
- Obliterated (or dismantled/razed) - Some people use railway=dismantled or railway=razed where all evidence of the line has been removed, others prefer such lines not to be included at all. This is used where the alignment has been replaced by new buildings or by roads which don't refer to the old alignment. Alternatively where the alignment now crosses farmland.
This section provides details of experimental tagging methods that have not yet been adopted and may not be supported by all rendering or tools.
Some users are adding a lifecycle prefix such as 'proposed:', 'construction:', 'disused:' and 'abandoned:' to tags to indicate changes to the tag values over time.
- An un-electrified line which it is being converted into an electrified line at 25KV at 50Hz using an overhead line might be tagged with:
- A freight-only line, not currently with any passenger operation:
- A former railway which was abandoned in 1965 and opened as a path ("railtrail") in 2003:
More complicated changes over time can be recorded using the date namespace suffix:
OpenRailwayMap (ORM) is a dedicated map for railways, displaying rail infrastructure as an overlay. Released in mid-2013, the project is available in numerous languages.
OpenPublicTransportMap (OPTM) displays passenger rail in route=train relations. At closer zooms, OPTM also displays route=light_rail, route=subway, route=tram, route=monorail, route=funicular, route=bus, route=trolleybus, route=aerialway and route=ferry with colors similar to ORM.
Thanks to Indy Hurt, here (was) another rail renderer which display(ed) rail-based passenger routes with their colour=* or color=* tag. Unfortunately, this is no longer functional, it is mentioned here as it was found useful by many, especially for visualizing international/national/regional/suburban differences of Amtrak™ routes in the USA.
A renderer similar to OPTM is öpnvkarte, displaying "worldwide public transport facilities on a uniform map." In addition to Train, Light rail, Tram, Subway, Ferry, Trolleybus and Bus routes, it includes Airports, Bus stops, Taxi ranks, Car rental and Bicycle rental nodes.
Please compare and contrast ORM (rail infrastructure) and OPTM (passenger rail, bus and ferry routes) with OSM's Transport layer which rather simply displays "any and all rail" (railway=*, excluding railway=disused and railway=abandoned) and at closer zooms, route=bus.
Mapnik and Carto (Standard)
Besides the basic railway=rail line style of alternating grey-solid/grey-hollow, Mapnik and Carto render railway=construction and railway=disused with a dotted line. railway=spur, railway=rail+service=siding, railway=rail+service=spur, and railway=rail+service=yard show as thinner forms of the railway=rail line style. railway=abandoned is not rendered.
Railway systems by country
- Czech Republic - railways, stations
- United Kingdom
- United States Note that in the United States, because of US English, "railroad" is frequently used across many contexts (not simply OSM) in preference to "railway" (which is more British English)
- "Do not render rail=abandoned" (#542), discussion on GitHub.