.get_overwritten_gtfs_stop_transfer_zone_mapping(+)

GtfsZoningReaderSettings method

Description

Collect the force overridden mapping between a GTFS stop and an existing PLANit transfer zone (assuming this has been indeed been overridden).

Since the reader allows for mapping a GTFS stop to multiple transfer zones this method returns a list rather than a single result. This is because, in case the GTFS information is more aggregate than the transfer zones (for example if the underlying network/zoning has resulted in separate platforms, but the GTFS stop reflects all platforms at once), the reader allows a single GTFS stop to be mapped to multiple transfer zones.

Signature

.get_overwritten_gtfs_stop_transfer_zone_mapping(gtfs_stop_id: str) -> List[Tuple[Union[int, str], IdMapperType]]

Return type

List[Tuple[Union[int, str], IdMapperType]] where for each entry in the list:

  • the first entry of the tuple reflects the mapped transfer zone id
  • the second entry of the tuple reflects the type of id the transfer zone id represents

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>)

## override mapping explicitly and then collect it ##
gtfs_reader.settings.zoning_settings.add_overwrite_gtfs_stop_transfer_zone_mapping(
            "gtfs_Stop_id_1", "osm_platform_way_id", IdMapperType.EXTERNAL)
assert len(gtfs_reader.settings.zoning_settings.get_overwritten_gtfs_stop_transfer_zone_mapping("gtfs_Stop_id_1")) == 1            

See also

N/A

Source code

Class GtfsZoningReaderSettingsWrapper in converterwrappers.py