PlanitNetworkWriterSettings

PlanitNetworkWriterSettings instance

The PlanitNetworkWriterSettings instance is accessible via the PlanitNetworkWriter its .settings property. It allows the user to configure the PlanitNetworkWriter.

Minimum configuration requirements

All methods marked as Compulsory=YES in the Methods section are expected to be configured by the user explicitly.

Methods

A PlanitNetworkWriterSettings instance exposes the following methods. The Compulsory column indicates it the user is expected to configure this setting explicitly or not.

Name Compulsory Default Description
.set_country(+) NO Context dependent Set the country this network resides in, used to determine the coordinate reference system to apply
.set_file_name(+) NO network.xml Set the network output file name to use (including extension)
.set_output_directory(+) YES N/A Set the output directory to persist the PLANit XML network file to

Properties

N/A

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

MatsimNetworkWriter Matsim network writer class these settings reside on

Source code

Class WriterSettingsWrapper in converterwrappers.py


.set_country(+)

PlanitNetworkWriterSettings method

.set_file_name(+)

PlanitNetworkWriterSettings method

.set_output_directory(+)

PlanitNetworkWriterSettings method