GeometryNetworkWriter

GeometryNetworkWriter instance

The GeometryNetworkWriter class instance can be created via the NetworkConverter. It provides the functionality to persist a network’s nodes and links in a GIS based format.

Using this network writer the outputs can be used to easily visualise PLANit network and services in a GIS based environment such as ARCGis or QGIS.

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

Defaults in Geometry Network Writer

The geometry network writer is based directly on the PLANit format, in this sense it does not perform a conversion but merely a different way of exporting the networks and services. Hence, no specific defaults regarding the conversion are required. Instead, all information is persisted 1:1 compared to the original PLANit data (only in a flat GIS format rather than its native hierarchical XML format)

Minimum configuration requirements

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

  • set an output directory via .settings.set_output_directory(+)
  • set the target country via .settings.set_country(+)

Methods

N/A

Properties

This class exposes the following properties:

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

Example 1 - Minimum required settings

from planit import *

planit = Planit()

# network converter
network_converter = planit.converter_factory.create(ConverterType.NETWORK)

# PLANit reader
planit_reader = network_converter.create_reader(NetworkReaderType.PLANIT, AUSTRALIA)
planit_reader.settings.set_input_directory(PLANIT_INPUT_PATH)

# GeoIo (GIS geometry shape) writer
geo_writer = network_converter.create_writer(NetworkWriterType.SHAPE)
geo_writer.settings.set_output_directory(OUTPUT_PATH)
geo_writer.settings.set_country("Australia")

# perform conversion
network_converter.convert(planit_reader, geo_writer)

See also

GeometryNetworkWriterSettings for configuration of the GIS 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 GeometryNetworkWriterWrapper in converterwrappers.py


.settings

GeometryNetworkWriter property