This vignette outlines how to produce GTFS timetables for the heavy rail network using ATOC CIF files.
Data for train timetables can be downloaded from ATOC you will need to register for a free account and log in.
You will get a zipped folder with a name like
To do a simple conversion to GTFS, load the package, and use the
atoc2gtfs function. The function requires the following
path_inis the file path to the ATOC timetable file, this comes a zipped folder with a name like
ncoresIf > 1 then multicore processing is used to speed up the processing. Always leave one spare core for your OS.
A simple example is shown below:
Once the conversion has been completed, you can save the GTFS file.
gtfs_write(gtfs, folder = "C:/GTFS", name = "gtfs_ttis627")
This will save the GTFS file to
CIF Files are available from Network Rail, the formatting is slightly
different and so a separate function
atoc2gtfs() function gives some customization
options to how the GTFS file is built. It is also just a wrapper around
other functions in the package. This section will explain the main
After unzipping the folder, the reading of the ATOC data is done with the following functions:
importMCA()the main file with the timetable data,
importFLF()optional file used if
transfers = TRUE
importMSN()optional file used if
locations = "file"
Other files are currently ignored.
The timetable data refers to locations such as stations, junctions,
etc using a TIPLOC id. The locations of these are stored in the
.msn file, but are not always accurate. Therefore the
package comes with a
tiplocs object which includes improved
location data for TIPLOCS.