Skip to content

Generate Transit Files Tool

Noel Peterson edited this page Apr 25, 2022 · 12 revisions

For a specified set of scenarios and output directory, this tool exports all of the necessary information out of the MHN coverage into scenario network transit files, which can then be imported into Emme for travel demand modeling. The Generate Highway Files tool (as well as the Master Rail Network (MRN)'s "Create Emme Scenario Files" tool) must have already been run for the same scenario(s) and output directory, as this tool relies on some of their respective outputs.

Before the transit files are generated, all bus runs from the bus_base or bus_current feature class (depending on scenario) are seperated by TOD period into temporary feature classes. The selection for each period, except 'AM', is made using the STARTHOUR field; the 'AM' period selects any runs for which AM_SHARE >= 0.5. The TOD-specific data is exported to temporary CSV files.

The program gtfs_reformat_feed.sas is called (via sasrun.bat) to reformat the TOD-specific bus itinerary data. This program subsequently calls gtfs_collapse_routes.py to determine, based on the reformatted itinerary data, which runs are similar enough to combine into a single "representative run". When the SAS program resumes, it chooses these "representative runs" for each set that is to be combined and calculates their average headways.

For each included TOD period, the program generate_transit_files_2.sas is called (via sasrun.bat) to analyze the highway project coding to determine the appropriate highway links in the scenario that the buses should run on. It also creates mode-b transfer links and three bus stop files (CTA stops, Pace stops and all stops), which are used later to create additional types of auxiliary links. All but one of the final Emme batchin bus files are created by this program. The list file (generate_transit_files_2_X00.lst, in the output transit folder) must be reviewed after the programs complete to ensure no coding errors were encountered. (These errors will not prevent this program from running.) This SAS program looks for the following coding issues:

  • Itinerary segment directional issues
  • Itinerary gaps
  • Too many layovers (more than 2) coded in an itinerary

Files of CTA rail and Metra stops are created from MRN batchin files for auxiliary link processing.

The distances between sets of bus stops, rail stops and zone centroids are calculated and, with the help of generate_transit_files_3.sas1, the final Emme transit batchin file is written.

Once all batchin files have been generated for a given scenario, the highway and rail linkshape files (created by the Generate Highway Files tool and Master Rail Network (MRN) processing, respectively) are merged together into a single file (linkshape_X00.in). This file will be placed in a "linkshape" folder in the same root folder as the highway and transit files. It can be imported into Emme to display true network geometry instead of simply straight lines.


  1. Prior to the C15Q1 release, the code currently in generate_transit_files_3.sas was all in generate_transit_files_4.sas, while generate_transit_files_3.sas performed the same task as the generate_rail_pnt_files() function now in generate_transit_files.py. Once that function was written, the old generate_transit_files_3.sas was deleted and generate_transit_files_4.sas was renamed for numerical consistency.

Clone this wiki locally