.set_discard_dangling_networks_below(+)
OsmNetworkReaderSettings method
Description
When dangling (sub)networks are marked to be removed, the user can configure below which number of nodes this occurs. If a network is dangling but larger than the set value it is retained.
Signature
.set_discard_dangling_networks_below(size:int)
with
Parameter | Type | Unit | Default | Description |
---|---|---|---|---|
size |
Integer |
None |
20 |
The size in number of nodes below 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 below 10 vertices from the final network
osm_reader.set_discard_dangling_networks_below(10)
See also
.set_remove_dangling_subnetworks(+)
Source code
Class OsmNetworkReaderSettingsWrapper
in converterwrappers.py