.set_input_file(+)
OsmIntermodalReaderSettings method
Description
Set the input file to parse by the OsmIntermodalReader
. This is a mandatory setting the user is expected to set. the Planit OsmIntermodalReader
supports
- OSM XML input files, see https://wiki.openstreetmap.org/wiki/OSM_XML
- OSM PBF input files, see https://wiki.openstreetmap.org/wiki/PBF_Format
It is recommended to use the PBF files since they are more compact.
Make sure the input file is locally available and you have access rights to read the file from where the OsmIntermodalReader
is running.
Signature
.set_input_file(input_file:str)
with
Parameter | Type | Unit | Default | Description |
---|---|---|---|---|
input_file |
String |
None |
N/A | The input file to extract the intermodal network from |
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>")
# 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
.set_input_file(+)
for url streaming based input
Source code
Class ReaderSettingsWrapper
in converterwrappers.py
Last modified January 1, 0001