.settings
GtfsIntermodalkReader property
The GtfsIntermodalReader
class instance can be created via the IntermodalConverter
.
It provides the functionality to process a GTFS dataset to supplement an existing network with public transport
services and infrastructure. In case there already exists public transport infrastructure in the form of poles and platforms
the reader will first try to match GTFS stops to existing poles and platforms based on a number of rules/heuristics such as
If no match can be found, a new stop in the form of a pole/platform (termed transfer zone in PLANit) will be created automatically.
As with all services in PLANit, the parsed public transport services will be routed on a service network
. A service network
sits on top of a physical network, where each service node represents a location where at least one service has a stop. service
legs
connect service nodes
, where each leg has at most two directional service leg segments
analogous to links and link
segments in physical networks, only here each service leg segment
may comprise multiple physical link segments.
Public transport services are captured in ‘RoutedServices` in PLANit, where each service is represented as a number of either schedule based trips or frequency based trips.
Because GTFS datasets have no network, an existing network(reader) has to be provided when constructing a GTFS intermodal reader. this network will then be used to attach the stops and services upon.
In the GTFS data format certain terminology is used. To avoid confusion the most common terms used are listed below:
mode
routed service
trip schedule
transfer zone
All configuration of this reader is performed via its .settings
property, providing access to the
GtfsIntermodalReaderSettings
.
The GTFS intermodal reader has extensive logging capabilities built in as well as additional settings to further expand (or reduce) logging and or warnings being generated. Typically, one would first perform a run with the basic settings, then analyse the logs, and then make further tweaks to the settings to address anomalies identified, activate/deactivate certain modes or mode mappings, override locations of GTFS stops to better align with the network, etc.
If, after reading the documentation, you remain unsure what defaults or settings to adopt, we recommend to do a trial run, inspect the generated logs and then go from there. PLANit will log the majority of the adopted defaults in its output when performing the OSM intermodal network reading.
The user is required to explicitly configure at least the following settings on an GtfsIntermodalReader
:
.settings.set_input_file(+)
During creation of the reader, make sure to provide the country of origin as well as the intermodal reader that is expected to provide the network (and zoning) used to place the GTFS stops and services on (see example below).
The EXTENDED GTFS RouteTypes (modes) are supported as defined in the GTFS specification. There is a default mapping available to PLANit predefined mode types, which may be altered by the user if so desired.
N/A
This class exposes the following properties:
Property | Availability | Description |
---|---|---|
.settings |
Always | Access to GtfsIntermodalReaderSettings to configure the reader |
from planit import *
# create an intermodal converter
planit_instance = Planit()
intermodal_converter = planit_instance.converter_factory.create(ConverterType.INTERMODAL)
# Network reader to use to impose GTFS on:
# Open Street Map (OSM) intermodal reader
osm_reader = intermodal_converter.create_reader(IntermodalReaderType.OSM, "Australia")
osm_reader.settings.set_input_file(SYDNEY_OSM_PBF_FILE_PATH)
# GTFS reader
gtfs_reader: GtfsIntermodalReaderWrapper = \
intermodal_converter.create_reader(IntermodalReaderType.GTFS, "Australia", osm_reader)
gtfs_reader.settings.set_input_file(SYDNEY_GTFS_FILE_PATH)
gtfs_reader.settings.services_settings.day_of_week = DayOfWeek.THURSDAY
gtfs_reader.settings.services_settings.add_time_period_filter(
datetime.time(hour=6, minute=0, second=0),
datetime.time(hour=9, minute=59, second=59)
)
# PLANit writer
planit_writer = intermodal_converter.create_writer(IntermodalWriterType.PLANIT)
planit_writer.settings.set_output_directory(OUTPUT_PATH)
planit_writer.settings.set_country("Australia")
# perform conversion (with services)
intermodal_converter.convert_with_services(gtfs_reader, planit_writer)
GtfsIntermodalReaderSettings
for configuration of the GTFS intermodal reader
OsmIntermodalReaderSettings
for configuration of the OSM intermodal (network, zoning) reader
ConverterFactory
for the converter factory to create other types of converters
IntermodalReaderType
for the supported intermodal reader types
IntermodalWriterType
for the supported intermodal writer types
Class GtfsIntermodalReaderWrapper
in converterwrappers.py
GtfsIntermodalkReader property