.activate_railway_parser(+)
OsmNetworkReaderSettings method
Description
Option to activate or deactivate the railway parser, i.e., all railways tagged with railway=
.
When activated the parser will consider all activated osm railway types, when deactivated it considers none of them.
By default the railway parser is de-activated for the
OsmNetworkReader
and activated for theOsmIntermodalReader
.
Signature
.activate_railway_parser(activate:bool)
with
Parameter | Type | Unit | Default | Description |
---|---|---|---|---|
activate |
Boolean |
None |
True /False |
(de)Activate the osm railway parser for rail based 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_highway_parser(+)
.railway_settings
for the settings related to OSM railways
Source code
Class OsmNetworkReaderSettingsWrapper
in converterwrappers.py