Package org.goplanit.utils.zoning
Class ConnectoidUtils
- java.lang.Object
-
- org.goplanit.utils.zoning.ConnectoidUtils
-
public class ConnectoidUtils extends Object
Utility functions around connectoids- Author:
- markr
-
-
Constructor Summary
Constructors Constructor Description ConnectoidUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Collection<DirectedConnectoid>
findDirectedConnectoidsReferencingLink(Link link, Map<org.locationtech.jts.geom.Point,List<DirectedConnectoid>> connectoidsByLocation)
find all directed connectoids from the provided container indexed by location that share an access node with the passed in link's link segmentsstatic Map<org.locationtech.jts.geom.Point,DirectedConnectoid>
findDirectedConnectoidsReferencingLinks(Collection<MacroscopicLink> links, Map<org.locationtech.jts.geom.Point,List<DirectedConnectoid>> connectoidsByLocation)
Collect all connectoids and their access node's positions if their access link segments reside on the provided links.static <C extends Connectoid,Z extends Zone>
voidupdateAccessZoneMapping(Iterable<C> connectoids, Function<Z,Z> zoneToZoneMapping, boolean removeMissingMappings)
Update the parent edge of all edge segments based on the mapping provided (if any)
-
-
-
Method Detail
-
findDirectedConnectoidsReferencingLink
public static Collection<DirectedConnectoid> findDirectedConnectoidsReferencingLink(Link link, Map<org.locationtech.jts.geom.Point,List<DirectedConnectoid>> connectoidsByLocation)
find all directed connectoids from the provided container indexed by location that share an access node with the passed in link's link segments- Parameters:
link
- to find referencing directed connectoids forconnectoidsByLocation
- connectoids to filter on- Returns:
- all identified directed connectoids
-
findDirectedConnectoidsReferencingLinks
public static Map<org.locationtech.jts.geom.Point,DirectedConnectoid> findDirectedConnectoidsReferencingLinks(Collection<MacroscopicLink> links, Map<org.locationtech.jts.geom.Point,List<DirectedConnectoid>> connectoidsByLocation)
Collect all connectoids and their access node's positions if their access link segments reside on the provided links. Can be useful to ensure these positions remain correct after modifying the network.- Parameters:
links
- to collect connectoid information for, i.e., only connectoids referencing link segments with a parent link in this collectionconnectoidsByLocation
- all connectoids indexed by their location- Returns:
- found connectoids and their accessNode position
-
updateAccessZoneMapping
public static <C extends Connectoid,Z extends Zone> void updateAccessZoneMapping(Iterable<C> connectoids, Function<Z,Z> zoneToZoneMapping, boolean removeMissingMappings)
Update the parent edge of all edge segments based on the mapping provided (if any)- Type Parameters:
C
- type od connectoidZ
- type of zone- Parameters:
connectoids
- to updatezoneToZoneMapping
- to use should contain original edge as currently used on vertex and then the value is the new edge to replace itremoveMissingMappings
- when true if there is no mapping, the parent edge is nullified, otherwise it is left in-tact
-
-