overwrite_waiting_area_of_stop_location.(+)

OsmPublicTransportReaderSettings method

Description

In OSM, a stop location for a public transport vehicle needs to be linked to a waiting area (transfer zone). This can be done explicitly by a tagging reference. However, often this is not available. In that case it is up to the parser to relate the stop location to the nearest compatible waiting area.

Sometimes, the nearest waiting area is not compatible with the stop location, e.g., a bus station with many stops and stop locations can have the closest stop being on the wrong side of the road for example. The original tagger likely did not consider this when creating the stop location and the stop location will be matched incorrectly if no action is taken.

Via this method the user can explicitly map a stop location to a waiting area that is known to be the correct one, circumventing any tagging references or the automated mapping mechanism of the reader.

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

The entity type parameter is required since OSM ids are only unique within each type, so an OSM id can represent both a node and a way

Signature

.overwrite_waiting_area_of_stop_location(osm_stop_location_id, osm_entity_type, osm_waiting_area_id)

Long stopLocationOsmNodeId, EntityType waitingAreaEntityType, Long waitingAreaOsmId

with

Parameter Type Unit Default Description
osm_stop_location_id Long None N/A Stop location to map
osm_entity_type OsmEntityType<enum> None N/A Type of waiting area (node, way)
osm_waiting_area_id Long None N/A Waiting area 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 stop location 1234 to OSM waiting area (which is a way, i.e. likely a platform) 56789
osm_reader.settings.pt_settings.overwrite_waiting_area_of_stop_location(1234, OsmEntityType.WAY, 56789)

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

See also

N/A

Source code

Class OsmPublicTransportSettingsWrapper in converterwrappers.py