MatsimNetworkWriter

MatsimNetworkWriter instance

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

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

Defaults in MATSim Network Writer

The Matsim writer relies on defaults whenever explicit configuration is absent. Detailed information on the adopted defaults can be found under; Defaults in the MatsimNetworkWriter. These mainly pertain to the mapping of Planit modes to Matsim modes.

If, after reading the documentation, you are still unsure what defaults are adopted, have a look at the generated logs. The majority of the adopted defaults are logged when performing the MATSim network writing.

Minimum configuration requirements

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

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

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

# perform conversion
network_converter.convert(osm_reader,matsim_writer)

See also

MatsimNetworkWriterSettings for configuration of the OSM 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
Matsim Network Writer Defaults detailing defaults

Source code

Class MatsimNetworkWriterWrapper in converterwrappers.py


.settings

MatsimNetworkWriter property

Matsim Network Writer Defaults

Detailed information on the adopted defaults