.exclude_all_gtfs_routes_except_by_short_name(+)

GtfsServicesReaderSettings method

Description

To quickly remove all GTFS routes from parsing except for a certain known select number use this method. This is especially useful for nodes that represent public transport can be bus stops, platforms, or stations. Sometimes these are incorrectly tagged, sometimes they are incompletely tagged, and sometimes there are user driven reasons they should be excluded. This method allows the user to explicitly exclude OSM nodes from being parsed to avoid warnings or errors.

If a particular GTFS route is seemingly behaving badly, this can be a good way to isolate it for separate analysis.

Signature

.exclude_all_gtfs_routes_except_by_short_name(gtfs_routes_by_short_name: List[str])

with

Parameter Type Unit Default Description
gtfs_routes_by_short_name List of str None N/A GTFS routes by their GTFs short name to not exclude

Return type

N/A

Example 1

from planit import *

# create an intermodal converter
planit_instance = Planit()
intermodal_converter = planit_instance.converter_factory.create(ConverterType.INTERMODAL)

from planit import *

# create an intermodal converter
planit_instance = Planit()
intermodal_converter = planit_instance.converter_factory.create(ConverterType.INTERMODAL)

# <some_intermodal_reader> = construct OSM or PLANit intermodal reader for example 

# GTFS reader
gtfs_reader: GtfsIntermodalReaderWrapper = \
    intermodal_converter.create_reader(IntermodalReaderType.GTFS, "Australia", <some_intermodal_reader>)

## exclude all but routes 431 and 433 ##
gtfs_reader.settings.services_settings.exclude_all_gtfs_routes_except_by_short_name([`431`,`433`])

See also

N/A

Source code

Class GtfsServicesReaderSettingsWrapper in converterwrappers.py