.exclude_osm_way_by_id(+)
Description
OSM way 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 an OSM way 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_way_by_id(osm_way_id: int)
with
Parameter | Type | Unit | Default | Description |
---|---|---|---|---|
osm_way_id |
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 OSM way from parsing due to identified issues
osm_reader.settings.pt_settings.exclude_osm_way_by_id(1234)
See also
Source code
Class OsmPublicTransportSettingsWrapper
in converterwrappers.py