Package org.goplanit.gtfs.util
Class GtfsLinkHelper
- java.lang.Object
-
- org.goplanit.gtfs.util.GtfsLinkHelper
-
public class GtfsLinkHelper extends Object
Utils class related to GTFS and PLANit link functionality- Author:
- markr
-
-
Constructor Summary
Constructors Constructor Description GtfsLinkHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
breakLinksAtPlanitNode(Node planitNode, MacroscopicNetworkLayer networkLayer, MacroscopicLink linkToBreak, Collection<GraphModifierListener> temporaryListeners, GtfsZoningHandlerData data)
break a PLANit link at the PLANit node location while also updating all related tracking indices and/or PLANit network link and link segment references that might be affected by this process: tracking of geo indexed PLANit links connectoid access link segments affected by breaking of link (if any)static Pair<Node,Boolean>
extractNodeByLinkGeometryLocation(org.locationtech.jts.geom.Point gtfsStopNodeLocation, MacroscopicLink referenceLink, MacroscopicNetworkLayer networkLayer, GtfsZoningHandlerData data)
Extract/create a PLANit node based on the given location.static Collection<MacroscopicLink>
findNearbyLinks(org.locationtech.jts.geom.Point location, double pointSearchRadiusMeters, GtfsZoningHandlerData data)
Find nearby links based on a given search radius
-
-
-
Method Detail
-
findNearbyLinks
public static Collection<MacroscopicLink> findNearbyLinks(org.locationtech.jts.geom.Point location, double pointSearchRadiusMeters, GtfsZoningHandlerData data)
Find nearby links based on a given search radius- Parameters:
location
- point location to search around (in WGS84 CRS)pointSearchRadiusMeters
- search radius to applydata
- containing state- Returns:
- found links around this location (in network CRS)
-
extractNodeByLinkGeometryLocation
public static Pair<Node,Boolean> extractNodeByLinkGeometryLocation(org.locationtech.jts.geom.Point gtfsStopNodeLocation, MacroscopicLink referenceLink, MacroscopicNetworkLayer networkLayer, GtfsZoningHandlerData data)
Extract/create a PLANit node based on the given location. Either it already exists as a PLANit node, or it is internal to an existing link. In the latter case a new node is created and the existing link is broken. In the former case, we simply collect the PLANit node. When we break the link all relevant GTFS relate state data is also updated to reflect the enw situation appropriately- Parameters:
gtfsStopNodeLocation
- to collect/create PLANit node for (can be slightly altered in case of rounding/syncing with reference link geometry)referenceLink
- the location is related to, can be internal can be an extreme nodenetworkLayer
- to extract node ondata
- containing state- Returns:
- PLANit node collected/created, and flag indicating if this required breaking a link and node is newly created (true), false otherwise
-
breakLinksAtPlanitNode
public static void breakLinksAtPlanitNode(Node planitNode, MacroscopicNetworkLayer networkLayer, MacroscopicLink linkToBreak, Collection<GraphModifierListener> temporaryListeners, GtfsZoningHandlerData data)
break a PLANit link at the PLANit node location while also updating all related tracking indices and/or PLANit network link and link segment references that might be affected by this process:- tracking of geo indexed PLANit links
- connectoid access link segments affected by breaking of link (if any)
- Parameters:
planitNode
- to break link at (its location, it is assumed node has already been created)networkLayer
- the node and link(s) reside onlinkToBreak
- the link to breaktemporaryListeners
- graph modifier listeners to register and apply when breaking link(s) at PLANit node location, and unregister afterwardsdata
- containing state
-
-