.exclude_osm_nodes_by_id(+)
Description
OSM nodes 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 OSM nodes 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_nodes_by_id(osm_node_ids: List[int])
with
Parameter | Type | Unit | Default | Description |
---|---|---|---|---|
osm_node_ids |
List of int |
None |
N/A | OSM nodes by their OSM node 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 nodes from parsing due to identified issues
osm_reader.settings.pt_settings.exclude_osm_nodes_by_id([1234,5678,91011])
See also
Source code
Class OsmPublicTransportSettingsWrapper
in converterwrappers.py