.overwrite_waiting_area_nominated_osm_way_for_stop_location(+)

OsmPublicTransportReaderSettings method

Description

Via this method the user can provide an explicit mapping for waiting areas (platform, bus stop, station) to a nominated OSM way (by its OSM id). This overrides the reader’s automated mapping functionality (ignoring explicit references to stop locations or closest osm way search). Instead it forces the reader to create a stop location on the nominated OSM way. It is recommended to only use this functionality when the platform has no explicitly referenced stop location and no stop_location maps to this waiting area. This method cannot be used in conjunction with using this waiting area in overriding stop_location mappings.

A good strategy is to run the OSM reader without any such mapping first, explore the generated warnings, errors, and other messages regarding the parsing process. Look up the stop locations/waiting areas and their tags on Open Street Map and then decide how to proceed, possibly by mapping the waiting area to another OSM way if needed.

The entity type parameter is required since waiting areas can be OSM nodes or ways and OSM ids are only unique within each type

Signature

overwrite_waiting_area_nominated_osm_way_for_stop_location(osm_waiting_area_id: int, osm_entity_type: OsmEntityType, osm_way_id: int)

with

Parameter Type Unit Default Description
osm_waiting_area_id int None N/A Waiting area to map to a specific OSM way
osm_entity_type OsmEntityType<enum> None N/A Type of waiting area (node, way)
osm_way_id int None N/A OSM way to map to

Return type

N/A

Example 1

from planit import *

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

# example Open Street Map (OSM) intermodal reader        
osm_reader = intermodal_converter.create_reader(IntermodalReaderType.OSM, "<country_name>")
osm_reader.settings.set_input_file("<path_to_input_file>")

# Map waiting area 1234 (which is a way, i.e. likely a platform) to OSM way 56789
osm_reader.settings.pt_settings.overwrite_waiting_area_nominated_osm_way_for_stop_location(1234,OsmEntityType.WAY,56789)

# Map waiting area 4321 (which is a node, i.e. likely a bus stop) to OSM way 9876
osm_reader.settings.pt_settings.overwrite_waiting_area_nominated_osm_way_for_stop_location(4321,OsmEntityType.NODE,9876)

See also

N/A

Source code

Class OsmPublicTransportSettingsWrapper in converterwrappers.py