From Open Rail Data Wiki
Revision as of 13:36, 6 August 2012 by BarryCarlyon (talk | contribs) (→‎Delete: I put the wrong packet in)
Jump to navigation Jump to search


The Schedule feed is an extract of train schedules from the Integration Train Planning System.

Schedule Data, cannot be obtained via Stomp, data is obtained by GZ file download from the Amazon S3 Data Buckets, each GZIP file consists of a collection of JSON strings.

The data consists of a primary set of data (rather large, can be 1.5GB in size) and a set of daily corrections that should be applied to the base data.

The data only contains Passenger Train Information.

   Freight services are not included in the schedule; all messages containing FOC codes are filtered out.

Obtaining the Data

Data is downloaded from Amazon S3. Each feed has a Bucket name and a File Name.

Each bucket has one or more files available within it. Normally the FULL_DAILY buckets will contain a single file (toc-full), where as the UPDATE_DAILY buckets will contain 7 files, one for each day.

Data is obtained from the Amazon S3 URL[bucket]&day=[file]

So for example

Will give you the Full Schedule for All Regions for Today.

You will need to be already logged into DataFeeds in a Web Browser to obtain the data, or if using cURL, HTTP Basic Auth, following HTTP Redirects will login, (using your Email/Password, not your security key)


Like the realtime data feeds, the Schedule data is split down into Train Provider and then from there down into the Full Schedule for that day and the daily updates.

So if you are building a local schedule database from scratch or are wiping your copy to build a fresh version.

  • First download and process the Full Daily.
  • And then daily grab the Daily update for that day and process that.

Files are normally updated around about Midnight UTC

A Daily Full file will only contain CREATE transactions, where as a Update can contain CREATE and DELETE transactions.

Each file contains,

  • a Data/information line,
  • a set of Schedule/Train Associations Transactions,
  • a set of Schedules Transactions,
  • an EOF message,

For the Update files. DELETE transactions are listed before CREATE transactions normally.

Files are New Line Delimited JSON Packets



       "owner":"Network Rail",


Gives the Last Update time of the File as a UNIX TIMESTAMP, in this example, Friday 3rd August 2012 01:07:30 +0100. All data should be send from the Rockshore Organisation.


  • The transaction type indicates, if this is a new Entry to create or old Entry to delete.
  • Location is a TIPLOC Reference
  • assoc_days represent if the Association is valid on the relevant day (MTWTFSS)


           "schedule_location": <snip>
  • atoc_code can be looked up on TOC_Codes (this example is missing)
  • Schedule Segment - signalling_id can be used to follow the train on the TD Feed
  • Schedule Segment - CIF Power Type is what is a reference to what is pulling the Train
  • Schedule Segment - CIF Speed is the top Speed of the Train
  • Schedule Segment - CIF Sleepers is the service a Sleeper Service
Schedule Location

Times are given in hhmm format, example 2005 for 5 minutes past 8 PM. (I'm not sure why some times are followed with a H)

Schedule Locations consists of none or more locations

The Path key can describe the route the train is expected to take into a station. For example Leeds Central when approaching from the South as Paths A-F

Platform Data is not always provided.

Schedule Locations come in three types

  • LO - Train Origin
  • LI - Stopping/Passing/Timing Point
  • LT - Train Terminus

Stopping points contain both the Arrival and Departure time for the Train

As the data is an array, the Index of the Array can be used to help determine Stop Order.

Train Origin

As a departure only reference only the departure keys are present

Stopping Point

This train arrives and ~1 minute later, is expected to leave.

Passing Point

Some stopping points are just Passing Points, used for routing trains over points for specific paths or lines.

Train Terminus

As this is an arrival entry, only arrival keys are present.



Just a handy note to say you reached the end of the file, in case you obtained a broken download.

Further Information

The first ~4% of the Full Daily file contains schedule associations, this links multiple Train UID's with a Primary Train UID, which can be looked up in the Schedules.

Due to the Size of the Full Daily, (1.5GB when gunzip'ed) it can take some time (about 2 hours) to import the data from the file.

A given Schedule entry, contains information about the schedule, including its Start and End dates, and can then contain one or more schedule stops, which describe the calling points for a train on its schedule. These calling points will have a official arrival/departure time and a Public arrival/departure time. When displaying data to the end user, its probably best to use the Public versions.