ferrobus.create_transit_model

ferrobus.create_transit_model#

ferrobus.create_transit_model(osm_path, gtfs_dirs, date, max_transfer_time=1200)#

Create a unified transit model from OSM and GTFS data

This function builds a complete multimodal transportation model by:

  • Processing OpenStreetMap data to create the street network

  • Loading GTFS transit schedules into RAPTOR model

  • Connecting transit stops to the street network

  • Creating transfer connections between nearby stops

The resulting model enables multimodal routing, isochrone generation, and travel time matrix calculations.

Parameters:
  • osm_path (str) – Path to OpenStreetMap PBF file containing street network data

  • gtfs_dirs (list[str]) – List of paths to directories containing GTFS data

  • date (datetime.date, optional) – Filter transit schedules to services running on this date. If None, includes all services.

  • max_transfer_time (int, default=1800) – Maximum walking time in seconds allowed for transfers between stops

Returns:

An integrated model for multimodal routing operations

Return type:

TransitModel

Raises:

RuntimeError – If the model creation fails due to data errors

Notes

The function releases the GIL during processing to allow other Python threads to continue execution.