OsmRailwaySettings

OsmRailwaySettings instance

The OsmRailwaySettings are accessible via the OsmNetworkReaderSettings.railway_settings property. It allows the user to configure the settings specific to OSM entities that are tagged as railway= which means all track/rail based infrastructure.

Here the user can choose which types of OSM railways to activate and deactivate in relation to the defaults that are already created based on the country of origin (or global defaults if no country is provided). Further modes can be allowed or disallowed access to specific types of railways in default situations. Of course, if the tagging explicitly allows or disallows access to modes, this takes precedence.

Methods

A OsmRailwaySettings instance exposes the following methods.

Name Default Description
.activate_all_osm_railway_types() N/A Activate all supported OSM railway types
.activate_osm_railway_types(+) N/A Activate OSM railway types indicated
.deactivate_all_osm_railway_types() N/A Deactivate all supported OSM railway types
.deactivate_all_osm_railway_types_except(+) N/A Deactivate all supported OSM railway types except the ones indicated
.deactivate_all_rail_modes_except(+) N/A Deactivate all OSM rail modes except the ones indicated
.deactivate_osm_railway_type(+) N/A Deactivate OSM railway type
.deactivate_rail_modes(+) N/A Deactivate indicated OSM rail modes
.overwrite_capacity_max_density_defaults(+) N/A Overwrite the default capacity (pcu/h/lane) max density (pcu/km/lane) for a given OSM railway type
.remove_osm_rail_mode_planit_mode_mapping(+) N/A Remove an existing (default) OSM rail mode to Planit road mode mapping

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>")

# indicate to activate all supported OSM railway types for parsing all rail based infrastructure
osm_reader.settings.activate_railway_parser(True)
osm_reader.settings.railway_settings.activate_all_osm_railway_types()

See also

NetworkReaderSettings parent settings class
OsmHighwaySettings settings for OSM highways

Source code

Class ReaderSettingsWrapper in converterwrappers.py


.activate_all_osm_railway_types()

OsmrailwaySettings method

.activate_osm_railway_types(+)

OsmRailwaySettings method

.deactivate_all_osm_railway_types()

OsmRailwaySettings method

.deactivate_all_osm_railway_types_except(+)

OsmRailwaySettings method

.deactivate_all_rail_modes_except(+)

OsmRailwaySettings method

.deactivate_osm_railway_type(+)

OsmRailwaySettings method

.deactivate_rail_modes(+)

OsmRailwaySettings method

.overwrite_capacity_max_density_defaults(+)

OsmRailwaySettings method

.remove_osm_rail_mode_planit_mode_mapping(+)

OsmRailwaySettings method

Last modified January 1, 0001