.set_default_directional_lanes_by_highway_type(+)
OsmLaneConfiguration method
The OsmLaneConfiguration
is accessible via the OsmNetworkReaderSettings.lane_configuration
property. It allows the user to configure the default number of lanes for specific OSM (highway/railway) types in case no explicit tagging is available that defines the number of lanes.
OSM suggests to only include specific lane tags if the number of lanes deviates from its proposed defaults. this OSM reader adopts those same suggested lane defaults to be compliant. However, this user is free to override these defaults and apply different values in case this is deemed more appropriate. They can do so via this class.
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
A OsmLaneConfiguration
instance exposes the following methods.
Name | Default | Description |
---|---|---|
.set_default_directional_lanes_by_highway_type(+) |
N/A | Set an number of lanes (per direction) for a given OSM highway type |
.set_default_directional_railway_tracks(+) |
N/A | Set an number of tracks (per direction) for OSM railway types |
N/A
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)
NetworkReaderSettings parent settings class
OsmHighwaySettings settings for OSM highways
Class ReaderSettingsWrapper
in converterwrappers.py
OsmLaneConfiguration method
OsmLaneConfiguration method