.exclude_osm_ways_by_id(+)

OsmPublicTransportReaderSettings method

Description

OSM ways that represent public transport can be platforms, platform edges, multi-polygons. 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 ways from being parsed to avoid warnings or errors.

an OSM way is any shape that is a line, or closed line (polygon), and is therefore not restricted to roads/rail

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 actual ways and their tags on Open Street Map and then decide how to proceed, possibly by excluding them via this method if needed.

Signature

.exclude_osm_ways_by_id(osm_way_ids: List[int])

with

Parameter Type Unit Default Description
osm_way_ids List of int None N/A OSM ways by their OSM way id to 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.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>")

# exclude some osm ways from parsing due to identified issues
osm_reader.settings.pt_settings.exclude_osm_ways_by_id([1234,5678,91011])

See also

Exclude OSM ways

Source code

Class OsmPublicTransportSettingsWrapper in converterwrappers.py