GeometryZoningWriter

GeometryZoningWriter instance

The GeometryZoningWriter class instance can be created via the ZoningConverter. It provides the functionality to persist a zoning’s origin-destination and transfer zones in a GIS based format. It also allows for persisting the virtual network, i.e., the connection between the zones and physical network in the form of connection links, referred to as connectoids/connectors.

Using this zoning writer the outputs can be used to easily visualise PLANit zoning (and virtual network) 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 GeometryZoningWriterSettings.

Defaults in Geometry Zoning Writer

The geometry zoning 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 zoning. 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 GeometryZoningWriter:

  • 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 GeometryZoningWriterSettings to configure the writer

Example 1 - Minimum required settings

from planit import *

planit = Planit()

# zoning converter
zoning_converter = planit.converter_factory.create(ConverterType.ZONING)

# prerequisite network reader
# PLANIT_INPUT_PATH = ...
planit_net_reader = planit_instance.converter_factory.create(ConverterType.NETWORK).create_reader(NetworkReaderType.PLANIT)
planit_net_reader.settings.set_input_directory(PLANIT_INPUT_PATH)

# PLANit zoning reader        
planit_reader = zoning_converter.create_reader(ZoningReaderType.PLANIT, planit_net_reader)
planit_reader.settings.set_inputdirectory(PLANIT_INPUT_PATH)

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

# perform conversion
zoning_converter.convert(planit_reader, geo_writer)

See also

GeometryZoningWriterSettings for configuration of the GIS zoning writer
ConverterFactory for the converter factory to create other types of converters
ZoningReaderType for the supported zoning reader types
ZoningWriterType for the supported zoning writer types

Source code

Class GeometryZoningWriterWrapper in converterwrappers.py


.settings

GeometryZoningWriter property