.settings
OsmNetworkReader property
The OsmNetworkReader
class instance can be created via the NetworkConverter
.
It provides the functionality to parse an OSM network in the PLANit format, and possible persist it in another format using a
NetworkWriter. Once created the user can configure its settings.
All configuration of this reader is performed via its .settings
property, providing access to the
OsmNetworkReaderSettings
.
The OSM reader relies on defaults whenever tagging information is absent, or assumed to revert to the implicit default as prescribed by OSM itself. Wherever possible this OSM reader aligns itself with the prescribed OSM defaults. In addition, the user can change these defaults if they deem this necessary. Detailed information on the adopted defaults can be found under; Defaults in the OSM Network Reader
If, after reading the documentation, you are still unsure what defaults Planit adopted, have a look at the generated logs. PLANit will log the majority of the adopted defaults in its output when performing the OSM network reading.
The user is required to explicitly configure at least the following settings on an OsmNetworkReader:
.settings.set_input_file(+)
, or alternatively,.settings.set_input_source(+)
N/A
This class exposes the following properties:
Property | Availability | Description |
---|---|---|
.settings |
Always | Access to OsmNetworkReaderSettings to configure the reader |
from planit import *
# create a network converter
planit_instance = Planit()
network_converter = planit_instance.converter_factory.create(ConverterType.NETWORK)
# 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>")
#or: osm_reader.settings.set_input_source("<URL_to_input_source>")
# example Planit network writer
planit_writer = network_converter.create_writer(NetworkWriterType.PLANIT)
planit_writer.settings.set_output_directory("<path_to_output_dir>")
planit_writer.settings.set_country("<country_name>")
# perform conversion
network_converter.convert(osm_reader, planit_writer)
OsmNetworkReaderSettings
for configuration of the OSM network reader
ConverterFactory
for the converter factory to create other types of converters
NetworkReaderType
for the supported network reader types
NetworkWriterType
for the supported network writer types
OSM Network Reader Defaults detailing defaults
Class OsmNetworkReaderWrapper
in converterwrappers.py
OsmNetworkReader property
Detailed information on the adopted defaults