Skip to content

Create Bus Layers

ccai-cmap edited this page Dec 15, 2025 · 16 revisions

This page describes 3_create_bus_layers.py, which creates bus layers for different scenarios. To use this tool, run

python [path-to-tool].

This script is a translation of the first half of the Generate Transit Files tool in the mhn_programs repository.

Input

Note: Before you run this tool, you MUST have already have run the Export Future Highways tool, so that your output folder already contains MHN_all.gdb.

input
|-- input_years.csv
`-- 1_travel
    `-- MHN.gdb
output
`-- 1_travel
    `-- MHN_all.gdb

Function

The script runs in two main steps. The first step is not concerned with scenarios, while the second step builds the bus network for a specified set of scenarios.

Step 1 - Collapse Bus Routes

  1. A GDB called collapsed_routes.gdb is created.
  2. Within that GDB, for each transit TOD (1, 2, 3, 4), the bus_base and bus_current feature classes (both GTFS) are partitioned according to the TOD period the runs fall into.
  3. For each TOD period, similar runs are collapsed / grouped together (similar meaning the runs share the same MODE-ROUTE_ID and have similar stopping patterns), and a representative run is chosen for each group (the run which is longest then earliest). The headway is calculated for each group.
  4. For representative runs, the corresponding itinerary is imported into the GDB and checked for errors. Itinerary gaps and false links are noted and written to the error file error_file_1.txt.
  5. We can think of the bus_future feature class as already being in its collapsed state. The corresponding future itineraries are imported and checked for errors the same way as the base/current itineraries, with itinerary gaps and false links being noted and written to the error file error_file_1.txt.
  6. The park and ride nodes are imported into the GDB.

Clone this wiki locally