Product(s): |
CUBE Voyager |
Version(s): |
6.4.x |
Area: |
Public Transport |
Introduction
Google Transit Feed Specifications (GTFS) are a set a standards defining common formats for sharing public transit data such as transit system information, route alignments, service schedules, individual trip details etc. GTFS is becoming the de-facto format for sharing public transit data. More information on GTFS can be found at https://gtfs.org/
GTFS data from transit agencies could contain a wealth of information useful for transportation planners for developing their transit networks. Many transit agencies publish their GTFS data on to public repositories or through their own channels. You can find a extensive collection of GTFS data at https://mobilitydatabase.org/
GTFS data has found common use among transportation modelers as a source to build public transport network inputs for their travel demand model. In this article, we will provide a CUBE 6 catalog for converting GTFS data to CUBE 6 Voyager PT line data. The following items are discussed below
- Set-up
- Input data
- Run parameters
- Output
- Limitations/Considerations
Solution
Set-up
The tool for converting GTFS data is provided as a CUBE 6 Catalog.You can download the zipped catalog from here. The catalog has a CUBE 6 Voyager NETWORK step to write out link and node data which is passed on to a Python script along with the GTFS datasets. The final outcome is a PT line file compatible with the input highway network.
Download the catalog and unzip it. Inside the unzipped folder, you should see the following folder structure:

This catalog has been tested to work on Python 3.12. If you do not have Python 3.12 already installed, please download and install from https://www.python.org/downloads/
The catalog requires the following Python packages which can be installed with pip.
Below are instructions for setting up these packages
GTFS Kit:
- Open command window and cd into the Python 3.12 installation directory
- Run command:
scripts\pip
install gtfs_kit
NetworkX:
- Open command window and cd into the Python 3.12 installation directory
- Run command:
scripts\pip
install networkx
Rtree:
- Open command window and cd into the Python 3.12 installation directory
- Run command:
scripts\pip
install Rtree
Input Data
There are two main inputs to this catalog:
- CUBE Highway Network - A CUBE 6 highway network forms the basis for building PT line data. The highway network could be in CUBE 6 native format (.NET) or as network feature class inside a CUBE 6 geodatabase. The network should be projected in the WGS84 spatial reference (lat, long) since this is the spatial reference used by GTFS data. This tool itself does not do a re-projection of the spatial reference. If your highway network is in a different spatial reference, then you should convert the network to WGS84. For CUBE 6 geodatabase networks, this is a simple re-projection which can be done using GIS tools such as QGIS or ArcGIS. For native format networks (.NET), it would be necessary to import them into a CUBE 6 geodatabase and re-projecting them using a GIS tool. A detailed highway network in terms of shapes and depth of network details (facility types) would provide the best outcome from this tool. The inputs folder is set-up to save your highway network.
- GTFS data zips - GTFS data is distributed as zipped archives. You do not need to unzip the files. The tool can unzip and process the files. The tool can handle multiple zip files, which makes it easier to build a singular CUBE 6 PT line data file, consisting of multiple transit agencies under your model region. All the GTFS zip files must be saved inside one folder. A inputs/gtfs folder is set-up to save your GTFS zip files.
Run parameters
The following run parameters are set-up as scenario keys.
- Highway Network - The highway network discussed in the input data section above.
- Path to GTFS zip files folder - The path to the folder where the zipped GTFS files for the run are saved as discussed in the input data section.
- Python Executable - Path to the Python 3.12 executable.
- Day type for transit service - Choose weekday, Saturday or Sunday transit service.
- Time period for transit service - Choose AM, MD, PM or NT transit service.
- Transit Modes - Select list of transit modes. The following mode numbers are assigned in the output file depending on the type.
- Tram - 1
- Subway - 2
- Rail - 3
- Bus - 4
- Ferry - 5
- Cable car - 6
- Gondola - 7
- Funicular - 8
Output
The output CUBE 6 PT line file (PTlines.lin) will be in the scenario directory. There is a dummy PT program box set-up in the application to open the file in the network window.

The output file can also be opened from the data panel under the outputs folder.

Limitations/Considerations
- The purpose of this tool is to provide a quick and easy way to output a draft CUBE 6 PT line file from GTFS datasets. The output from the tool might not be ideal and should always be reviewed and fixes applied based on other data.
- The output line file should have all unique lines in the transit service. So, you might see lines with small changes in alignment between them.You might want to delete the duplicate lines with small alignment differences and only keep lines which represent the main alignments.
- GTFS datasets where services are given as exception types and not as weekly schedules(No calendar.txt but only calendar_dates.txt) are not handled by the tool. Most GTFS data should have weekly schedules and should not have a problem.
- Published GTFS datasets can contain errors in many cases which might cause this tool to not-perform as expected. In these cases, further effort might be needed to identify the issues and obtain the correct GTFS datasets.