PlanitNetworkReader

PlanitNetworkReader instance

The PlanitNetworkReader class instance can be created via the NetworkConverter. It provides the functionality to parse networks in the native PLANit format, and possibly persist it in the same or another format using a NetworkWriter. 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 reader is performed via its .settings property, providing access to the PlanitNetworkReaderSettings.

Minimum configuration requirements

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

  • set an input directory via .settings.set_inputdirectory(+)

Methods

N/A

Properties

This class exposes the following properties:

Property Availability Description
.settings Always Access to PlanitNetworkReaderSettings to configure the reader

Example 1 - Minimum required settings

from planit import *

# create a network converter
planit_instance = Planit()
network_converter = planit_instance.converter_factory.create(ConverterType.NETWORK)

# PLANit network reader        
planit_reader = network_converter.create_reader(NetworkReaderType.PLANIT)
planit_reader.settings.set_inputdirectory("<path_to_input_dir>")

# example Matsim network writer
matsim_writer = network_converter.create_writer(NetworkWriterType.MATSIM)
matsim_writer.settings.set_output_dir("<path_to_output_dir>")

# perform conversion
network_converter.convert(planit_reader,matsim_writer)

See also

PlanitNetworkReaderSettings for configuration of the Planit 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

Source code

Class PlanitNetworkReaderWrapper in converterwrappers.py


.settings

PlanitNetworkReader property