.set_country(+)
Description
Set the destination country of the to be generated Matsim files by the MatsimIntermodalWriter
. This country name is used to determine the best possible coordinate reference system (projection) to use for the geometry information of the outputs.
If the country is not set by the user, the choice for the destination coordinate reference system is based on the coordinate reference system of the source network that is to be persisted. This is likely sufficient in most cases, but sometimes a country specific projection is required in which case the country can be provided here.
Whenever a country name is to be supplied, make sure this name complies with the ISO 3166 standard (see for example https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes ).
Signature
.set_country(country_name:str)
with
Parameter | Type | Unit | Default | Description |
---|---|---|---|---|
country_name |
String |
None |
Context dependent | The destination country name (ISO 3166) |
Return type
N/A
Example 1
from planit import *
# create a network 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)
matsim_writer.settings.set_output_directory("<path_to_output_dir>")
# Set country explicitly to Australia: Australian Lambert projection will be adopted
matsim_writer.settings.set_country("Australia")
# perform conversion
intermodal_converter.convert(osm_reader,matsim_writer)
See also
N/A
Source code
Class MatsimIntermodalWriterSettingsWrapper
in converterwrappers.py