.exclude_osm_node_by_id(+)

OsmPublicTransportReaderSettings method

Description

OSM node that represent public transport can be bus stops, platforms, or stations. 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 an OSM node from being parsed to avoid warnings or errors.

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 nodes 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_node_by_id(osm_node_id: int)

with

Parameter Type Unit Default Description
osm_node_id int None N/A OSM node 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 OSM nodes from parsing due to identified issues
osm_reader.settings.pt_settings.exclude_osm_node_by_id(1234)

See also

Exclude OSM ways

Source code

Class OsmPublicTransportSettingsWrapper in converterwrappers.py