.activate_highway_parser(+)
OsmNetworkReaderSettings method
The OsmNetworkReaderSettings
instance is accessible via the OsmNetworkReader
its .settings
property. It allows the user to configure the OsmNetworkReader. We differentiate between:
All general settings are accessible directly via methods on this class. All specific settings require accessing a dedicated settings or configuration property within this class. Currently, the following specific settings properties are available:
The highway settings relate to all road infrastructure (including footways, bicycle paths, busways etc.). The railway settings relate to all track/rail based infrastructure (heavy rail, light rail, etc.). within these settings types of road/rail can be activated or deactivated, and modes can be added or removed by default if required. The lane configuration settings relate to the user setting defaults for the number of lanes for the various road types, usefull when - for example - they are not explicitly tagged in the network and the user is not happy with the defaults .
The terminology used within this settings class (highway, railway) is based on the naming conventions adopted by Open Street Maps and are not specific to Planit.
All methods marked as Compulsory=YES
in the Methods section are expected to be configured by the user explicitly.
A OsmNetworkReaderSettings
instance exposes the following methods. The Compulsory column indicates it the user is expected to configure this setting explicitly or not.
Name | Compulsory | Default | Description |
---|---|---|---|
.activate_highway_parser(+) |
NO | TRUE |
Parse highways or not (all non tracked roads are tagged as highways) |
.activate_railway_parser(+) |
NO | FALSE |
Parse railways or not (all tracked infrastructure falls under railways) |
.deactivate_all_osm_way_types_except(+) |
NO | N/A | Deactivate parsing all OSM way types except the ones flagged by user |
.exclude_osm_ways_from_parsing(+) |
NO | N/A | Explicitly mark certain osm ways from being parsed by their OSM way id |
.overwrite_mode_access_by_osm_way_id(+) |
NO | N/A | Explicitly override the allowed modes for a certain osm way by its OSM way id |
.set_always_keep_largest_subnetwork(+) |
NO | TRUE |
Indicate keep largest subnetwork when removing dangling subnetworks |
.set_bounding_box(+) |
NO | TRUE |
Mark a bounding box to which the reader is restricted within the OSM file |
.set_discard_dangling_networks_above(+) |
NO | Infinity |
Set threshold of nodes above which a dangling subnetwork is removed |
.set_discard_dangling_networks_below(+) |
NO | 20 |
Set threshold of nodes under which a dangling subnetwork is removed |
.set_keep_osm_ways_outside_bounding_box(+) |
NO | N/A | Mark OSM ways to be kept even if they fall (partially) outside the user specified bounding box |
.set_input_file(+) |
YES | N/A | Set the input file (local file based) to parse by the OSM network reader |
.set_input_source(+) |
YES | N/A | Set the input source (URL streaming) to parse by the OSM network reader |
.set_remove_dangling_subnetworks(+) |
NO | TRUE |
Remove dangling subnetworks or not after parsing |
Setting either the input file or input source suffices, both need not be set.
This class exposes the following properties
Property | Availability | Description |
---|---|---|
.highway_settings |
Always | Settings specific to OSM entities tagged as highway= |
.lane_configuration |
Always | Settings specific to the configuration of OSM lanes in case tags are absent |
.railway_settings |
Always | Settings specific to OSM entities tagged as railway= |
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>")
#or: osm_reader.settings.set_input_source("<URL_to_input_source>")
# example Planit network writer
planit_writer = network_converter.create_writer(NetworkWriterType.PLANIT)
planit_writer.settings.set_output_directory("<path_to_output_dir>")
planit_writer.settings.set_country("<country_name>")
# perform conversion
network_converter.convert(osm_reader,planit_writer)
OsmNetworkReader
Osm network reader class these settings reside on
Class OsmNetworkReaderSettingsWrapper
in converterwrappers.py
OsmNetworkReaderSettings method
OsmNetworkReaderSettings method
OsmNetworkReaderSettings method
OsmNetworkReaderSettings method
OsmNetworkReaderSettings property
OsmNetworkReaderSettings method
OsmNetworkReaderSettings property
OsmNetworkReaderSettings method
OsmNetworkReaderSettings method
OsmNetworkReaderSettings method
OsmNetworkReaderSettings method
OsmNetworkReaderSettings method
OsmNetworkReaderSettings method
OsmNetworkReaderSettings method
OsmNetworkReaderSettings method
OsmHighwaySettings instance
OsmHighwaySettings instance
OsmRailwaySettings instance