.convert(+)

IntermodalConverter method
Description

The method that is to be called to perform the conversion from reader to writer.

Signature

.convert(reader, writer)

with

Parameter Type Unit Compulsory Description
reader IntermodalReader None YES The intermodal reader used to parse from
writer IntermodalWriter None YES The intermodal writer used to persist to

Return type

N/A

Example 1

from planit import *

# create an intermodal converter
planit_instance = Planit()
intermodal_converter = planit_instance.converter_factory.create(ConverterType.INTERMODAL)

# example Open Street Map (OSM) intermodal reader        
osm_reader = intermodal_converter.create_reader(IntermodalReaderType.OSM, "<country_name>")
osm_reader.settings.set_input_file("<path_to_input_file>")

# example PLANit intermodal writer
planit_writer = intermodal_converter.create_writer(IntermodalReaderType.PLANIT)
planit_writer.settings.set_output_directory("<path_to_output_dir>")
planit_writer.settings.set_country("<country_name>")

# perform conversion
intermodal_converter.convert(osm_reader, planit_writer)

See also

N/A

Source code

Class IntermodalConverter in converter.py