Skip to content
Home » Projects » Project: Open Night Train Database

Project: Open Night Train Database

The lack of information about night trains, let alone the lacking single platform to book a train from one place in Europe to another, is obviously one of the major obstacles in promoting the usage of night trains. Various projects tried to fill the gap but maintaing complete and up-to data is a task no single project has yet achieved. As bad information can be worse than no information the idea of this project is to invite different, partially competing actors actors across Europe to join forces based on the priciples of open data and open source in order to achieve our common goal of better information services on night trains better and quicker than each for themselves.

Start of this project: June 2023
Deadline for this project: ongoing

Project coordinators: Howard Osbourne (ERC UK)

Principles and Assumptions:

  • There is a common interest to join forces to enable a better information services to night train passengers (including daytrains would be beyond scope)
  • Though some participants would like to keep their interface, possibly for commercial purposes, there is a common interest in contributing to a joint open sorce data base. Open source should thus allow for commercial usage. 
  • Software used for gathering data shall be open source too in order to cover as many operators as possible.
  • The maintainer must be charitable organisation. This will be Back-on-Track Germany e.V. for the time being. We asked Openrailfoundation to step in, as this would be even better, however, their focus is on sharing software, not data, so they will not take care for our infrastructure any time soon.
  • To allow for different editors to contribute and to correct parts of the data, we will use Google Sheets.
  • For managing versions of the static data files, scrapers, assigning tasks and discussing solutions we will use our GitHub Account.
  • For instant discussions we use a Slack workspace. Participants are advised not to mute the general channel, nor to spam the general channel with infomations that belong in sub-channels.
  • We structure static general night train information as GTFS-compliant as possible. This will ease exporting and hopefully importing GTFS-compliant data files. This standard can also be used to make train data availabe in applications like Google Flights to promote trains as a sustainable alternative, so datasets will be available
  • We will not support NeTEx Standard any time soon as it requires too much learning.
  • We store seldomly & manually maintaned data in a Google Sheet. We store frequently & automatically updated data (from scrapers or APIs) in an relational DB. The database will also import the manually maintained data.
  • BoT DE funds server space for establishing the database for storing dynamic data.
  • Acces will be free but requires authentication.

Conceptual decisions so far:

Open Tasks:

  • Open GitHub and Slack account with charity conditions completed
  • Rent server space at Hetzner. completed
  • Static data conception with default data completed
  • Complete static data including rough itineraries completed
  • Align static data with GTFS namespace completed
  • Clarify the API requirements for services using only static data not necessary
  • Design WordPress displaying a full-scale, scaleable map and an infobox pop-up completed
  • Implement as a WordPress (Gutenberg) plug-in not necessary
  • POC1: display static data on a SVG-based map. (on nighttrains.net) completed
  • Dynamic data conception with default data
  • Setup of the Dynamic Database
  • Adapt existing ÖBB Collector(s) to create dynamic data
  • Adapt ÖBB Collector to be controlled by analyzing static data (calendar)
  • Clarify the API requirements for services using dynamic data
  • POC2: display dynamic data on a SVG-based map (nachtzugkarte.de and/or nighttrains.net)
  • Create a new collector forn a different operator
  • Get a sample GTFS file from an operator
  • Test a GTFS importer
  • dynamic map display of routes based on departure location and date
  • Roll-Out

The Night Train Map:

The night trains registered in the database are visualised on the night train map, with both digital and printed versions.

The web version of the night train map is a regular page inside the WordPress of back-on-track.eu. The CSS and Javascript code is encapsulated in WordPress shortcodes using the “Post snippets” plugin. The page contains:

  • Some hand-made CSS styling to present the page with a different header that integrates smoothly with the map. This is the first CSS code block in the page editor.
  • The map SVG (with ‘width = “100%”‘ in the <svg>-Tag and no <title>-Tag).
  • Some additional styling of the map and the info boxes.
  • Javascript code for the interactive functionalities of the map (the shortcode for this block uses additional parameters for translation).
  • … and below that regular WordPress blocks for the contents of the page below the map.

Project coordinators: Titus Laska (BoT DE)