Deutsche Bahn platform information, enriched with OSM data.
CC-BY-4.0 License
Deutsche Bahn platform information, enriched with OSM data.
You're invited to help, see the definitions, data structure and contributing sections!
Using this original dataset provided by Deutsche Bahn.
Since the word platform is ambiguous in the English language (some people use it refering to the tracks at which trains depart while some people think of it as the place where you wait for your train, see also here), we use the following terms in this readme:
term | definition | π«π· | π΅π± | π©πͺ |
---|---|---|---|---|
perron | The area where you wait for your train, right next to the tracks | quai | peron | Bahnsteig |
track | Tracks (their numbers) are usually announced via speakers or visible on a departure board. There are often two tracks at one perron. | voie | tor | Gleis |
If you're using JavaScript
, you can use the package by installing:
npm install db-platforms
const tracks = require('db-platforms')
The module exposes a list of tracks. Tracks contain the following information:
db-stations
module to retrieve additional information.[
{
id: '8000001:1',
name: '1',
longName: 'Gleis 1',
station: '8000001',
perron: {
id: '8000001:B01',
name: 'B01',
station: '8000001',
length: 168,
height: 76
},
osmPlatform: { // null if not tagged yet
type: 'way',
id: '33170523'
},
osmStopPosition: { // null if not tagged yet
type: 'node',
id: '215971279'
}
},
{
id: '8000001:2',
name: '2',
longName: 'Gleis 2',
station: '8000001',
perron: {
id: '8000001:B02',
name: 'B02',
station: '8000001',
length: 387,
height: 76
},
osmPlatform: { // null if not tagged yet
type: 'relation',
id: '5151598'
},
osmStopPosition: { // null if not tagged yet
type: 'node',
id: '215971391'
notUnique: true // only set in rare cases where multiple tracks are represented by the same stop positon, e.g. for tracks where you can exit a train on both sides
}
},
// β¦
]
We aim to associate the following OpenStreetMap entities with tracks.
type | association |
---|---|
osmStopPosition |
Point on a metal rail, mapped in OSM as a node with attribute public_transport=stop_position , sometimes has an attribute ref or local_ref containing the track number |
osmPlatform |
Perron area or edge close to the rail, mapped in OSM as a way or relation (MultiPolygon) with attribute public_transport=platform , railway=platform or railway=platform_edge , sometimes has an attribute ref containing the numbers of adjacent tracks. |
Even though OpenStreetMap platforms and this module's perrons describe the same concept, we don't store OSM platform associations on perrons, but rather on individual tracks. This happens for the following reasons:
OpenStreetMap associations are stored in osm-stop-positions.ndjson
and osm-platforms.ndjson
, ndjson files which contain one record per row. All records are objects with the following keys (required).
key name | description | example |
---|---|---|
id |
Track id | "8011674:1" |
osmType |
Type of the OSM entity, either node , way or relation . Always node for stop positions
|
"way" |
osmId |
Id of the OSM entity, undefined if broken=true or obsolete=true . Note that OSM ids are not too stable, however this still seems to be the best way to associate data (for now). Additionally, tests that verify that ids are still valid and refering to public_transport entities are run on a daily basis. |
"378453650" |
stationName |
Name of the station. Note that this field is required, but won't ever be parsed, we just use it to make the dataset a bit more human-readable. | "Gorgast" |
revised |
Some entries have been automatically fetched/guessed from tagged OSM nodes (false ), while others have been manually inserted (true ). This field is currently not exposed by the module, but can be used internally to monitor quality. |
true |
notUnique |
Only for stop positions. Usually, the tests will fail if one osm stop_position id is associated with multiple tracks. However, in some rare cases, e.g. for tracks where you can exit a train on both sides, you can allow an osm id to be added for multiple tracks by setting notUnique=true . |
not set |
Put together, our example would give us the following data row for osm-platforms.ndjson
:
{"id":"8011674:1","osmType":"way","osmId":"378453650","stationName":"Gorgast","revised":true}
The original dataset contains some old tracks/perrons that don't really exist at the time (e.g. tracks that will never be served, semi-demolished perrons, β¦). These are stored in obsolete.ndjson
and will be filtered out in the module's build process.
If you want to add information to the dataset, fork this repository, add information and finally submit a pull request. If you don't know how any of this works, you can also just open an issue with the information you want to add in text form and I'll add it to the dataset for you. The same applies if you have found an error or want to change anything about the data structure.
Please note that by contributing to this project, you waive any copyright claims on the information you add.
See the todo list for a list of stations that have not been (fully) covered yet.
If you want to contribute to this project, you can either add data to osm-stop-positions.ndjson
and osm-platforms.ndjson
manually or use the CLI as follows:
git clone https://github.com/juliuste/db-platforms.git
cd db-platforms
osm-stop-positions.ndjson
and osm-platforms.ndjson
./build/bin/index # starts the cli
./build/bin/index --help # shows the help menu
./build/bin/index --auto-open # starts the CLI, opens OpenStreetMap around stations automatically (only on mac OS, using 'open' CLI)
The original dataset was released as CC-BY 4.0, the crowdsourced database of OpenStreetMap associations is licensed as CC0.