August 2024 version. You can find information on continuous adjustments in our Changelog.
Current information on releases
Realisation specifications RV 2.0.6 and 2.0.7
Activation of the adjustments in accordance with the new realisation specifications RV 2.0.6 and 2.0.7 is planned for 29 October 2024. [Update 2024-10-25: Activation has been postponed to a date yet to be determined.] Both specifications are implemented simultaneously. Test data is available on Test data sets HRDF realisation specifications 2.0.6 and 2.0.7 .
The following files are affected by the new HRDF version:
File FPLAN
*GR lines are no longer supported
*SH lines are no longer supported
*VV lines are now supported. They include
- Estimated delay in minutes
- Stop from which the delay applies
- Stop to which the delay applies
- Departure time
- Time of arrival
Example
1 |
*VV 0010 8507000 8503000 % Expected delay of 10 minutes from HST no. 8507000 to HST no. 8503000 |
File ATTRIBUT
The description now starts in column 5 (instead of 4).
Example (new):
1 2 |
VR VELOS: Reservation obligatory VR BICYCLES: Reservation required |
Old:
1 2 |
VR VELOS: Reservation obligatory VR BICYCLES: Reservation required |
Files ATTRIBUT_DE / ATTRIBUT_EN / ATTRIBUT_FR / ATTRIBUT_IT
The files ATTRIBUT_DE, ATTRIBUT_EN, ATTRIBUT_FR, ATTRIBUT_IT are no longer provided. However, the different language variants are all contained in the ATTRIBUT file.
File BETRIEB
- First line: Unique identifier (SBOID) (after the “N”) is provided.
- Second line: From version 2.0.7, there can only be one TU code per SBOID.
Example (new with SBOID):
1 2 3 4 |
00244 K "DB " L "DB Regio" V "DB RegioNetz Verkehrs GmbH Westfrankenbahn" N "ch:2:sboid:DE800603" 00244 : 800603 00245 K "DB " L "DB Regio" V "DB RegioNetz Verkehrs GmbH Westfrankenbahn" N "ch:2:sboid:DE8006A7" 00245 : 8006A7 |
Old (currently without SBOID):
1 2 |
00244 K "DB " L "DB Regio" V "DB RegioNetz Verkehrs GmbH Westfrankenbahn" 00244 : 800603 8006A7 |
File BHFART
- From version 2.0.7, only the BHFART file will be made available.
- If known, the global IDs (for Switzerland the Swiss Location ID (SLOID)) of the stop and track are provided.
- with an “A” as a prefix, the global IDs of the stops are made available
- With an “a” as a prefix, the global IDs of the tracks are made available
- A stop can have several quays (i.e. places for boarding and alighting at the stop in question, for example). The same quay can be assigned to several stops.
- The “Country” information is provided for each stop with the identifier L
- The “Canton” information is provided for each stop. The information is transmitted with an *I line and the infotextcode “KT”
The SLOIDs are already productively exchanged in the BHFART_60 file.
1 2 3 4 5 6 7 |
8501200 G A ch:1:sloid:1200 8501200 L CH % Vevey 8503000 I KT 000001235 (and a corresponding entry in the INFOTEXT file) 8501200 G a ch:1:sloid:1200:3:5 8501200 G a ch:1:sloid:1200:2:2 8501200 G a ch:1:sloid:1200:2:4 8501200 G a ch:1:sloid:1200:1:1 |
File GLEISE
The files GLEISE_WGS and GLEISE_LV95 will now be available. The other GLEIS_xx files will no longer be available.
File KMINFO
The “Comment” column begins with the special character % from position 21.
Example (new):
1 2 |
0000140 0 % Gotthard panoramic route 8508253 100 % Heimberg |
Old:
1 2 |
0000140 0 Gotthard panoramic route 8508253 100 Heimberg |
File ZUGART
- The mode of transport is now also supplied for each offer category. The information is transmitted with an *I line and the infotextcode “VM”.
- The attribute “Ausgabesteuerung” now has two digits. The attributes that occur after this are shifted by one position.
Example (new):
1 |
ICE 0 A 0 ICE 0 #030 |
Old:
1 |
ICE 0 A 0 ICE 0 #030 |
Background
What is HRDF?
The Hafas Raw Data Format (HRDF) is a proprietary file format for timetable data.
Who is behind it?
The company Hacon has developed the Hacon Fahrplan-Auskunfts-System (HAFAS), which uses HRDF for data exchange.
Why does the Open Data platform offer this?
The HAFAS system (see above) is widely used in public transport, which has made HRDF one of the standards in the industry. It also covers many aspects of customer information that are not (currently) available in other formats.
You can find more information on the assessment of HRDF as a standard in the report (German) by the Federal Office of Transport (FOT).
How do I access the data/interfaces?
Data
The timetable in HRDF format (e.g. for 2024): https://opentransportdata.swiss/en/dataset/timetable-54-2024-hrdf For the car transport (e.g. for 2024): https://opentransportdata.swiss/en/dataset/timetable-54-2024-hrdf-autoverlad The current draft timetable: https://opentransportdata.swiss/en/dataset/timetable-54-draft-hrdf Interfaces HRDF is not an interface standard. |
Technical description
What information do we map with HRDF? (size)
- Swiss public transport timetable data and journeys in the area close to the Swiss border.
- Note: For cross-border trains, the Swiss part of the journey is included up to the first commercial stop abroad (in the direction of abroad) or the last commercial stop abroad (in the direction of Switzerland).
- All information for an entire timetable period (e.g. 2024).
How is the information structured? (model)
An HRDF export consists of several files, which almost all have to be viewed together for an overall picture. For details, please refer to the realisation specification (RV v2.0.5 (July 2023, German) or RV v2.0.7 (May 2024)) and the official HRDF documentation (available on request: contact form).
To a certain extent, the HRDF file can be viewed as a database dump. The individual files in the ZIP correspond to individual tables or objects.
Please note:
- NOMEN EST OMEN does NOT (always) apply to HRDF files. For example, the “BAHNHOF” file contains not only railway stations, but all stops (including bus stops, for example).
- The format of the HRDF files is designed for a compact, machine-readable structure. Therefore:
- are frequently related but not identical contents in the same file
- contents are indicated with an “*” followed by a letter, e.g. “*Z” (so the interpreting system knows what comes next)
- the structure of each line following an “*” is strictly regulated in the HRDF documentation. Each part of a line has a predetermined width (number of characters), the parts are separated by spaces. Example:
- It can be defined that the first part of a line contains the ID of a stop and may only be 5 characters long and the next part (from character 6 to character 10) identifies the company owning the stop.
- So the line could look like this: 12345_67891, where _ visualises the space. If there is no company and the field is optional, then characters 6-10 would only be spaces.
- HRDF thus differs from other common file formats such as CSV, where content is separated with a comma, or JSON, where content is represented in a structured way (with various characters): content in HRDF is limited in its scope and position on each line.
- There are files that are part of the HRDF export we provide that are empty. These are only included in the sense of interoperability of decreasing systems. We deliberately do NOT list them in the following description.
Overall, the HRDF data can be divided into (1) master data, (2) time-relevant data, (3) timetable data and (4) transfer data. We will go into the content in more detail below.
Technical description (What is in the HRDF files? (contents))
This section roughly describes each individual file of the HRDF model including examples from the HRDF export (detailed information can be found in the RV and HRDF documentation). In addition, we do not describe the files alphabetically, but starting from node files. For example, we first introduce FPLAN as one of the central files and then describe the files referenced by this file, etc. Thus we divide the description into:
- Timetable file (FPLAN) and its references and general information
- You need to find out:
- when will
- travelled from where to where
- on which days of the year
- By which means of transport
- with which line
- with which additional services and restrictions
- with which further details (SJYID, etc.)
- As well as for time-relevant information:
- Validity
- Public holidays
- Time zones
- You need to find out:
- Stops file (BAHNHOF) and its references
- Needed for the following information on stops:
- Name
- Grouping of several stops
- Coordinates of the stops
- ID of the stops
- Transfer information within and between stops
- Needed for the following information on stops:
Timetable file (FPLAN) and its references and general information
Extract from the model overview. An arrow means that a key is “pointed to” in the referenced file:
Area | Specialised content | File name | Description | ||||||||||||||||||
Time-relevant data | Validity of the delivery | ECKDATEN |
Life of the timetable The timetable data is valid for the defined period. The duration usually corresponds to that of the timetable period Can be read in decoupled from other data. |
||||||||||||||||||
Time-relevant data | General public holidays | FEIERTAG |
List of public holidays that apply in Switzerland. In addition to the date of the holiday, the description of the holiday is listed in four languages: DE, FR, IT, EN Can be read in decoupled from other data. |
||||||||||||||||||
Time-relevant data | Time zones | ZEITVS |
Definition of the time zones, including the date when the summer and winter time changes take place Further details on this topic and its implementation in Switzerland can be found in the RV There are 2 types of representation:
|
||||||||||||||||||
Time-relevant data | Validity in the year | BITFELD |
Day-specific definition of the validity of the timetable information. The validity is defined using a bit pattern. Each day is represented by a bit. In each case, 4 bits are combined to form a hexadecimal digit. To interpret the bit field, it is important to understand how the timetable years work (more information here). A timetable year usually lasts one year, but the timetable year begins on the 2nd weekend in December. This means that a timetable year is not always the same length. To deal with this, the bit field is assumed to be 400 days long. File contains:
Example (excerpt) – Hex insetead of bits:
|
||||||||||||||||||
Timetable data | Timetable | FPLAN |
List of journeys and by far the largest and most comprehensive file in the HRDF export. This file contains:
|
||||||||||||||||||
Timetable data | Through-connections | DURCHBI |
List of ride pairs that form a contiguous run. Travellers can remain seated. This construct is used, among other things, for the formation of the wing trains. File contains:
Example (excerpt):
|
||||||||||||||||||
Master data | Service categories (aka means of transport (type)) | ZUGART | List of service categories. Per language the (Class:) grouping of offer categories with identical characteristics. (Option:) Search criteria for the application for connection search. (Categorie:) Designation of the offer category.
Note again: The term “Angebotskategorie* (offer category) may have a different meaning here than in colloquial language! A colloquial term (also according to the HRDF doc.) would be “means of transport” (type). This file is modified in Switzerland:
|
||||||||||||||||||
Master data | Offers | ATTRIBUT |
List of abbreviations describing additional offers (e.g.: dining car) or restrictions (e.g.: seat reservation obligatory). Note again: The term “Angebot” (offer) may be imprecise here. The HRDF doc. uses the word “attribute”, which is also somewhat imprecise. Basically, it is a collective term for extensions (e.g. dining car) or restrictions (e.g. no bicycles) that apply. An overview of the means of transport (and instructions) can be found in the following link: Lists of means of transport and instructions This file contains:
Example (excerpt):
Example (excerpt):
Example (excerpts):
|
||||||||||||||||||
Master data | Info texts | INFOTEXT_*
*DE,*FR,*IT,*EN |
Additional information on objects (journeys, lines, etc.). This information can either be
The INFOTEXTCODE attribute defines whether these are simple texts or texts with a semantic meaning. The INFOTEXTCODE is not in the INFOTEXT file, but only in the INFOTEXT referencing files, e.g. FPLAN. A list of the INFOTEXTCODE used can be found under the following LINK.. |
||||||||||||||||||
Master data | Lines | LINIE |
List of lines. The file contains:
The following property codes are supported:
Example (excerpt):
|
||||||||||||||||||
Master data | Direction | RICHTUNG |
Directional information. More details:
For example, if a train travels between Sargans and Chur, it is labelled as travelling in the direction of Chur. Example (excerpt):
|
||||||||||||||||||
Master data | Transport company | BETRIEB_**DE,*FR,*IT,*EN | List of transport companies. The term “transport company” is understood in different ways. In the context of opentransportdata.swiss, it is understood that it is an organisation that is responsible for the runs described in the FPLAN. A detailed description of the transport companies and business organisations can be found here.
Each TU is described in detail with 2 lines:
Example (excerpt):
|
Stops file (BAHNHOF) and its references
Extract from the model overview. An arrow means that a key is “pointed to” in the referenced file. For a better overview, BAHNHOF / STATION and BETRIEB / OPERATION are represented by placeholders.
Not repeated: ZUGART, LINIE, BETRIEB_*, FPLAN:
Bereich | Fachlicher Inhalt | Dateiname | Beschreibung | ||||||
Master data | Stops | BAHNHOF |
List of stops A detailed description of the stops (incl. Meta-stops (see METABHF file)) can be found here. The file contains stops that are referenced in various files:
Example (excerpt):
Example – Search for Basel instead of “Basel SBB” (excerpt):
|
||||||
Master data | Meta stops | METABHF |
Grouping of stops for the search. By grouping the stops, the search for transport chains takes place at all stops in the group. There are 2 parts. file contains:
Example (excerpt):
|
||||||
Master data | Stop coordinates | BFKOORD_*
*WGS84, *LV95 |
List of stops with their geo-coordinates. File contains:
Example (excerpt):
|
||||||
Master data | Station type | BHFART*
*, *_60 |
Definition of the type of stops, i.e. whether the stop should be able to serve as a start and/or destination, or as a via location, and whether it has a global ID (for Switzerland the Swiss Location ID (SLOID)).
The BHFART_60 variant of the BHFART file also contains the risers (with an “a” as a prefix) of the stations (with an “A” as a prefix). So if the example below says “A”, it describes a stop and not a platform belonging to this stop. A stop can have several platforms (i.e., for example, places to board and alight at the stop in question). File contains:
The format is included:
Example (excerpt):
Caveat: There are currently no different sloids for sectors and sector groups. However, these can have their own coordinates. Depending on the application, the sloid (if it is used as an id) should be supplemented with “: “+”designation” (e.g. ch:1:sloid:7000:501:34:AB) in the internal system. However, this is NOT a new official ID. |
||||||
Master data | Transfer priority | BFPRIOS | Definition of the priority of the stops The transfer priority allows you to select the transfer point if there are several transfer options. It is shown with a value between 0 and 16, where 0 is the highest priority and 16 is the lowest priority. File contains:
Example (excerpt):
|
||||||
Master data | Weighting of transfer points | KMINFO | This file is primarily relevant for HAFAS. HAFAS recognises transfer points automatically. This file should therefore only be used to assign numbers of 2 30000 and 0 (see below). In Switzerland, however, it contains more figures. Specifically, various numbers between 0 and 30000. The same figures indicate a similarly manageable changeover. The file differs from BFPRIOS in that it defines closures and transfers in general, i.e. a location can or cannot be used for transfers. The further division is a configuration of the changeover logic used in addition to BFPRIOS. File contains:
Example (excerpt):
|
||||||
Timetable data | Track and bus platform information | GLEISE_*
*WGS, *LV95 |
List of track and bus platform information. File contains:
Example (excerpt):
Description
This creates the overall picture by linking the two pieces of information. IMPORTANT NOTE on *WGS and *LV95, as well as “GLEIS” vs “GLEISE”: These two files will replace the “pure” GLEIS and GLEIS_* files in Switzerland in 2024. So GLEISE_WGS and GLEISE_LV95 remain. Accordingly, we have also documented these directly here. With the replacement, only the second part changes as follows (further details on this topic and the implementation in Switzerland can be found in the RV):
Example (excerpt):
|
||||||
Transfer data | Transfer time between journeys | UMSTEIGZ | List of journey pairs that have a special transfer relationship. File contains:
Example (excerpt):
|
||||||
Transfer data | Transfer time at a stop | UMSTEIGB | General transfer time or per stop. The file contains:
Example (excerpt):
Example (excerpt):
|
||||||
Master data | Transfer time between lines | UMSTEIGL | Transfer time per category of service and/or line. The file contains:
Example (excerpt):
|
||||||
Master data | Transfer time between transport companies | UMSTEIGV | Transfer time between two transport companies:
Example (excerpt):
|