.set_default_directional_lanes_by_highway_type(+)
OsmLaneConfiguration method
Description
Override the default number of lanes per direction for the given OSM highway type. This default is only applied when no explicit number of lanes is provided on the OSM way itself.
For information on the assumed defaults by OSM (and therefore Planit) regarding lanes, see https://wiki.openstreetmap.org/wiki/Key:lanes under the heading Assumptions
Signature
.set_default_directional_lanes_by_highway_type(highway_type:str, number_of_lanes_dir:int)
with
Parameter | Type | Unit | Default | Description |
---|---|---|---|---|
highway_type |
String |
None |
N/A | OSM highway type to set the new defaults for |
number_of_lanes_dir |
Integer |
Type dependent | N/A | New default to apply (per direction) |
Return type
N/A
Example 1
from planit import *
# create a network converter
planit_instance = Planit()
network_converter = planit_instance.converter_factory.create(ConverterType.NETWORK)
# example Open Street Map (OSM) network reader
osm_reader = network_converter.create_reader(NetworkReaderType.OSM, "<country_name>")
osm_reader.settings.set_input_file("<path_to_input_file>")
# update default number of lanes for all motorways to 4, i.e., 8 for two directions
osm_reader.settings.lane_configuration.set_default_directional_lanes_by_highway_type("motorway",4)
See also
N/A
Source code
Class ReaderSettingsWrapper
in converterwrappers.py