.settings

GtfsIntermodalkReader property
Description

The .settings property allows access to the settings of the GtfsIntermodalReader. Since this is an intermodal reader (with services parsing capability) it - internally - comprises a zoning reader, service network reader, as well as a routed services reader. Therefore, within the main settings property, the further dedicated settings properties are available , namely specific settings for services, via services_settings and poles/platforms settings, via zoning_settings (because in PLANit stops are modelled as transfer zones, hence they are captured in the zoning).

Return type

GtfsIntermodalReaderSettings implementation

Example 1

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)

See also

GtfsIntermodalReaderSettings the settings available

Source code

Class GtfsIntermodalReaderWrapper in converterwrappers.py