OsmLaneConfiguration

OsmHighwaySettings instance

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

Methods

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

Properties

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

NetworkReaderSettings parent settings class
OsmHighwaySettings settings for OSM highways

Source code

Class ReaderSettingsWrapper in converterwrappers.py

Last modified January 1, 0001