public class PrepareRoutingSubnetworks extends Object
Sometimes there are also subnetworks that can be reached from the main network but not the other way around (or the opposite). For example this can be parking lots that can only be accessed by a single one-way road (a mapping error). These are called 'one-way subnetworks' and are marked using the same subnetwork encoded value, see #86. To find such one-way subnetworks it is important to search for strongly connected components on the directed graph and not do a simple connectivity check for one direction.
Note that it depends on the weighting whether or not edges belong to a subnetwork or not. For example if a weighting 'closes' a bridge to an island the island might become a subnetwork, but if the bridge was open it would belong to the main network. There can even be subnetworks that are due to turn restrictions.
We always run an edge-based connected component search, because this way we retrieve the edges (not the nodes) that belong to each component and can include turn restrictions as well. Node-based component search is faster, but since the subnetwork search goes relatively fast anyway using it has no real benefit.
Modifier and Type | Class and Description |
---|---|
static class |
PrepareRoutingSubnetworks.PrepareJob |
Constructor and Description |
---|
PrepareRoutingSubnetworks(GraphHopperStorage ghStorage,
List<PrepareRoutingSubnetworks.PrepareJob> prepareJobs) |
Modifier and Type | Method and Description |
---|---|
int |
doWork()
Finds and marks all subnetworks according to
setMinNetworkSize(int) |
PrepareRoutingSubnetworks |
setMinNetworkSize(int minNetworkSize)
All components of the graph with less than 2*
minNetworkSize directed edges (edge keys) will be marked
as subnetworks. |
public PrepareRoutingSubnetworks(GraphHopperStorage ghStorage, List<PrepareRoutingSubnetworks.PrepareJob> prepareJobs)
public PrepareRoutingSubnetworks setMinNetworkSize(int minNetworkSize)
minNetworkSize
directed edges (edge keys) will be marked
as subnetworks. The biggest component will never be marked as subnetwork, even when it is below this size.public int doWork()
setMinNetworkSize(int)
Copyright © 2012–2021. All rights reserved.