Class ConnectoidUtils


  • public class ConnectoidUtils
    extends Object
    Utility functions around connectoids
    Author:
    markr
    • Constructor Detail

      • ConnectoidUtils

        public ConnectoidUtils()
    • 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 for
        connectoidsByLocation - 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 collection
        connectoidsByLocation - 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 connectoid
        Z - type of zone
        Parameters:
        connectoids - to update
        zoneToZoneMapping - to use should contain original edge as currently used on vertex and then the value is the new edge to replace it
        removeMissingMappings - when true if there is no mapping, the parent edge is nullified, otherwise it is left in-tact