PlanitNetworkWriter

PlanitNetworkWriter instance

The PlanitNetworkWriter class instance can be created via the NetworkConverter. It provides the functionality to persist a network in the native Planit format . Once created the user can configure its settings.

For information on the PLANit XML format, please consult the Data formats/Input/Default section

All configuration of this writer is performed via its .settings property, providing access to the PlanitNetworkWriterSettings.

Minimum configuration requirements

The user is required to explicitly configure at least the following settings on a PlanitNetworkWriter:

  • set an output directory via .settings.set_output_directory(+)

Methods

N/A

Properties

This class exposes the following properties:

Property Availability Description
.settings Always Access to PlanitNetworkWriterSettings to configure the writer

Example 1 - Minimum required settings

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>")

# PLANit network writer
planit_writer = network_converter.create_writer(NetworkWriterType.PLANIT)
planit_writer.settings.set_output_directory("<path_to_output_dir>")

# perform conversion
network_converter.convert(osm_reader,planit_writer)

See also

PlanitNetworkWriterSettings for configuration of the Planit network writer
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

Source code

Class PlanitNetworkWriterWrapper in converterwrappers.py


.settings

PlanitNetworkWriter property