Class GtfsTransferZoneHelper


  • public class GtfsTransferZoneHelper
    extends Object
    Utils class related to GTFS and PLANit transfer zone functionality
    Author:
    markr
    • Constructor Detail

      • GtfsTransferZoneHelper

        public GtfsTransferZoneHelper()
    • Method Detail

      • createAndRegisterNewTransferZone

        public static TransferZone createAndRegisterNewTransferZone​(GtfsStop gtfsStop,
                                                                    org.locationtech.jts.geom.Point projectedGtfsStopLocation,
                                                                    TransferZoneType type,
                                                                    GtfsZoningHandlerData data)
        Helper method to create and register a new transfer zone based on a GTFS stop
        Parameters:
        gtfsStop - to use
        projectedGtfsStopLocation - projected location to use
        type - type of transfer zone
        data - containing state
        Returns:
        created and registered transfer zone
      • getLastTransferZoneExternalId

        public static String getLastTransferZoneExternalId​(TransferZone transferZone)
        extract last entry from Transfer zone external id based on comma separation
        Parameters:
        transferZone - to use
        Returns:
        last entry or empty string
      • isGtfsStopOnCorrectSideOfTransferZoneAccessLinkSegments

        public static boolean isGtfsStopOnCorrectSideOfTransferZoneAccessLinkSegments​(GtfsStop gtfsStop,
                                                                                      Mode gtfsMode,
                                                                                      TransferZone transferZone,
                                                                                      GtfsZoningHandlerData data,
                                                                                      boolean allConnectoidsMustMatch)
        Verify based on driving direction and orientation of the access link segment(s) whether the GTFS stop is a viable match for the found transfer zone in terms of being on the correct side of the road. The assumption here is that this pertains to a road based stop not rail and connectoids being available for the provided transfer zone to extract this information
        Parameters:
        gtfsStop - to verify
        gtfsMode - used
        transferZone - to verify against
        data - containing state
        allConnectoidsMustMatch - flag indicating whether we require all connectoids to be on the correct side of the road (true), or not (false)
        Returns:
        true when on correct side of the road, false otherwise
      • findTransferZoneStopLocationClosestTo

        public static Pair<TransferZone,​Double> findTransferZoneStopLocationClosestTo​(org.locationtech.jts.geom.Coordinate gtfsStopLocation,
                                                                                            Collection<TransferZone> nearbyTransferZones,
                                                                                            GtfsZoningHandlerData data)
        find the transfer zone (underlying stop locations if any) closest to the provided GTFS stop location. In case the transfer zone has no stop locations registered, we use its overall geometry to match the distance to the GTFS stop location.
        Parameters:
        gtfsStopLocation - to find closest transfer zone for
        nearbyTransferZones - to consider
        data - containing state
        Returns:
        found closest transfer zone
      • findNearbyTransferZones

        public static Collection<TransferZone> findNearbyTransferZones​(org.locationtech.jts.geom.Point location,
                                                                       double pointSearchRadiusMeters,
                                                                       GtfsZoningHandlerData data)
        Find nearby zones based on a given search radius
        Parameters:
        location - point location to search around (in WGS84 CRS)
        pointSearchRadiusMeters - search radius to apply
        data - containing state
        Returns:
        found transfer zones around this location (in network CRS)