.set_output_file_name(+)

MatsimPtServicesWriterSettings method

Description

Set a different file name to use for the output file, without the extension. The default file name for the converted zoning is transitschedule since it is expected to only be used for persisting public transport infrastructure. All MATSim output is in XML format, hence the final result would be named transitschedule.xml.

Signature

.set_output_file_name(output_file_name:str)

with

Parameter Type Unit Default Description
output_file_name String None transitschedule The output file name (without extension)

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)

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

# MATSIM intermodal writer
matsim_writer = intermodal_converter.create_writer(IntermodalWriterType.MATSIM)
# This updates zoning and network output dir 
matsim_writer.settings.set_output_directory("<path_to_output_dir>")

# Set output file name explicitly for the zoning (pt) aspect
matsim_writer.settings.zoning_settings.set_output_file_name("my_new_transit_schedule_name") 

# perform conversion
intermodal_converter.convert(osm_reader,matsim_writer)

See also

N/A

Source code

Class WriterSettingsWrapper in converterwrappers.py