.set_generate_matrix_based_pt_router_files(+)
MatsimZoningWriterSettings method
Description
Indicate if the writer should - in addition to - the transit schedule XML file, also generate CSV files compatible with MATSim’s Matrix based PT router, see Github example.
Presently, PLANit will generate a ptStops.csv
comprising the stop ids and their location when activated.
In future versions PLANit might also be able to generated a stop-to-stop travel time matrix in addition, but since MATSim provides functionality to generate this on-the-fly when not providing one, this has not yet been implemented.
Signature
.set_generate_matrix_based_pt_router_files(flag)
with
Parameter | Type | Unit | Default | Description |
---|---|---|---|---|
flag |
Boolean |
None |
True |
Flag to determine if CSV(s) should be created |
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>")
# Explicitly switch on generation of additional CSV files to support Matrix based PT routing in MATSim
matsim_writer.settings.zoning_settings.set_generate_matrix_based_pt_router_files(True)
# perform conversion
intermodal_converter.convert(osm_reader,matsim_writer)
See also
N/A
Source code
Class WriterSettingsWrapper
in converterwrappers.py