NetworkWriterType.<enum>

NetworkWriterType types

Description

Class exposing the available types as enums for creating a particular type of network writer compatible with the PLANit NetworkConverter.

Fields

<enum> Fields Description Instance documentation
MATSIM Use to create a MATSim network writer through NetworkConverter instance N/A
SHAPE Use to create a Geometry shape file network writer through NetworkConverter instance N/A
PLANIT Use to create a Planit native network writer through NetworkConverter instance N/A

Example 1

from planit import *

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

# Open Street Map reader        
osm_reader = network_converter.create_reader(NetworkReaderType.OSM, "<country_name>")
osm_reader.settings.set_input_file("<path_to_input_file>")

# PLANit 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)

See also

Planit on how to access the ConverterFactory instance via Planit instance
ConverterFactory for information on the ConverterFactory class NetworkConverter for information on the NetworkConverter class

Source code

Class NetworkWriterType in enums.py