.set_overwrite_gtfs_stop_location(+)

GtfsZoningReaderSettings method

Description

Force override the location of a GTFS stop.

This can be very useful in case alignment between the network and the GTFS dataset is problematic. This is especially critical for bus stops which are expected to be on the correct side of a road as they only provide entrance on one side. When a GTFS stop is slightly misaligned with the network (or vice-versa), it may happen that the reader cannot attach the stop to the correct link. In such cases the reader will generally provide a warning for the user to verify the correctness of the chosen solution.

If it is found the wrong mapping is applied this may be easily fixed by slightly moving the GTFS stop, this can be done by updating its location via this method.

Signature

.set_overwrite_gtfs_stop_location(gtfs_stop_id: str, latitude: float, longitude: float)

with

Parameter Type Unit Default Description
gtfs_stop_id str N/A N/A The GTFS stop id this overwrite relates to
latitude float N/A N/A The new latitude of the GTFS stop
longitude float N/A N/A The new longitude of the GTFS stop

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

## override location ##
gtfs_reader.settings.zoning_settings.set_overwrite_gtfs_stop_location("a_gtfs_stop_id", 33.33, 148.148)            

See also

N/A

Source code

Class GtfsZoningReaderSettingsWrapper in converterwrappers.py