.day_of_week
GtfsServicesReaderSettings method
The GtfsServicesReaderSettings
are accessible via the GtfsIntermodalReaderSettings.services_settings
property. These settings are specific to the configuration of parsing public transport services provided in the GTFS dataset.
During parsing these public transport services are converted into PLANit routed services running on a service network which in turn is built on top of the physical road, rail, and water network.
A GtfsServicesReaderSettings
instance exposes the following methods.
Name | Default | Description |
---|---|---|
.activate_logging_for_gtfs_route_by_short_name(+) |
N/A | Activate extended logging for a particular GTFS route during parsing |
.add_log_gtfs_stop_routes(+) |
N/A | Provide GTFS stops for which the reader will log all passing GTFS routes |
.add_time_period_filter(+) |
N/A | Restrict parsing to a particular time period within the day |
.exclude_all_gtfs_routes_except_by_short_name(+) |
N/A | Exclude all GTFS routes except the ones provided here explicitly |
.exclude_gtfs_routes_by_short_name(+) |
N/A | Exclude particular GTFS routes from parsing explicitly |
.get_time_period_filters() |
N/A | Get the currently configured time period filters within the day |
.is_activated_logging_for_gtfs_route_by_short_name(+) |
N/A | Verify if extended logging for a particular GTFS route during parsing is activated |
.is_group_identical_gtfs_trips(+) |
True |
Verify whether identical GTFS trips within a service are to be grouped |
.is_gtfs_route_included_by_short_name(+) |
N/A | Verify if a given GTFS route is included, as in it has not been excluded |
.is_include_partial_gtfs_trips_if_stops_in_time_period() |
True |
Verify whether partially available GTFS trips (due to time period filters) are included |
.set_include_partial_gtfs_trips_if_stops_in_time_period(+) |
True |
Flag whether to include partially available GTFS trips (due to time period filters) |
.set_group_identical_gtfs_trips(+) |
True |
Flag whether to group identical GTFS trips within a service when possible |
.is_log_gtfs_stop_route(+) |
N/A | Verify whether we are logging all passing GTFS routes for the given stop |
A GtfsServicesReaderSettings
instance exposes the following properties to set and/or get.
Name | Default | Description |
---|---|---|
.day_of_week |
N/A | Filter GTFS dataset to a single day of the week |
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 parent settings class
Class GtfsServicesReaderSettingsWrapper
in converterwrappers.py
GtfsServicesReaderSettings method
GtfsServicesReaderSettings method
GtfsServicesReaderSettings method
GtfsServicesReaderSettings method
GtfsServicesReaderSettings method
GtfsServicesReaderSettings method
GtfsServicesReaderSettings method
GtfsServicesReaderSettings method
GtfsServicesReaderSettings method
GtfsServicesReaderSettings method
GtfsServicesReaderSettings method
GtfsServicesReaderSettings method
GtfsServicesReaderSettings method
GtfsServicesReaderSettings method