.set_discard_dangling_networks_above(+)

OsmNetworkReaderSettings method

Description

When dangling (sub)networks are marked to be removed, the user can configure above which number of nodes this occurs. If a network is dangling but smaller than the set value it is retained.

Signature

.set_discard_dangling_networks_above(size:int)

with

Parameter Type Unit Default Description
size Integer None 20 The size in number of nodes above which dangling subnetworks will be discard

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

# indicate to remove dangling subnetworks explicitly
osm_reader.set_remove_dangling_subnetworks(True)
# remove all found dangling subnetworks above 10 vertices from the final network
osm_reader.set_always_keep_largest_subnetwork(False)
osm_reader.set_discard_dangling_networks_above(10)

See also

.set_remove_dangling_subnetworks(+)
.set_always_keep_largest_subnetwork(+)

Source code

Class OsmNetworkReaderSettingsWrapper in converterwrappers.py