.activate_highway_parser(+)
OsmNetworkReaderSettings method
Description
Option to activate or deactivate the highway parser, i.e., all roads tagged with highway=
. When activated the parser
will consider all activated osm highway types, when deactivated it considers none of them.
By default, the highway parser is activated. This call is delegated to the same method in .highway_settings
.
Signature
.activate_highway_parser(activate:bool)
with
Parameter | Type | Unit | Default | Description |
---|---|---|---|---|
activate |
Boolean |
None |
True |
(de)Activate the osm highway parser for road networks |
Return type
N/A
Example 1
from planit import *
# create a network converter
planit_instance = Planit()
network_converter = planit_instance.converter_factory.create(ConverterType.NETWORK)
# example Open Street Map (OSM) network reader
osm_reader = network_converter.create_reader(NetworkReaderType.OSM, "<country_name>")
osm_reader.settings.set_input_file("<path_to_input_file>")
# indicate to only parse rail network
osm_reader.activate_highway_parser(False)
osm_reader.activate_railway_parser(True)
See also
.activate_railway_parser(+)
.highway_settings
for the settings related to OSM highways
Source code
Class OsmNetworkReaderSettingsWrapper
in converterwrappers.py