Class GtfsZoningHandlerTransferZoneData


  • public class GtfsZoningHandlerTransferZoneData
    extends GtfsConverterHandlerData
    Zoning handler data specifically tailored towards transfer zones
    Author:
    markr
    • Constructor Detail

      • GtfsZoningHandlerTransferZoneData

        public GtfsZoningHandlerTransferZoneData​(ServiceNetwork serviceNetwork,
                                                 GtfsZoningReaderSettings settings,
                                                 Zoning referenceZoning)
        Constructor
        Parameters:
        serviceNetwork - to use
        settings - to use
        referenceZoning - to use
    • Method Detail

      • reset

        public void reset()
        Reset the PLANit data tracking containers
      • registerMappedGtfsStop

        public void registerMappedGtfsStop​(GtfsStop gtfsStop,
                                           TransferZone transferZone)
        Register transfer as mapped to a GTFS stop, index it by its GtfsStopId, and register the stops as mapped
        Parameters:
        gtfsStop - to register on PLANit transfer zone
        transferZone - to register one
      • getMappedTransferZone

        public TransferZone getMappedTransferZone​(GtfsStop gtfsStop)
        Get the transfer zone that the GTFS stop was already mapped to (if any)
        Parameters:
        gtfsStop - to use
        Returns:
        PLANit transfer zone it is mapped to, null if no mapping exists yet
      • hasMappedGtfsStop

        public boolean hasMappedGtfsStop​(TransferZone transferZone)
        Check if transfer zone already has a mapped GTFS stop
        Parameters:
        transferZone - to check
        Returns:
        true when already mapped by GTFS stop, false otherwise
      • getMappedGtfsStop

        public GtfsStop getMappedGtfsStop​(String gtfsStopId)
        Retrieve a GTFS stop that has been mapped to a pre-existing PLANit transfer zone
        Parameters:
        gtfsStopId - to use
        Returns:
        found GTFS stop (if any)
      • getSupportedPtModesIn

        public Set<Mode> getSupportedPtModesIn​(TransferZone planitTransferZone,
                                               Set<Mode> modesFilter)
        The pt services modes supported on the given transfer zone
        Parameters:
        planitTransferZone - to get supported pt service modes for
        modesFilter - to select from
        Returns:
        found PLANit modes
      • registerTransferZoneToConnectoidModes

        public void registerTransferZoneToConnectoidModes​(TransferZone transferZone,
                                                          DirectedConnectoid directedConnectoid,
                                                          Collection<Mode> activatedPlanitModes)
        Update registered and activated pt modes and their access information on transfer zone
        Parameters:
        transferZone - to update for
        directedConnectoid - to extract access information from
        activatedPlanitModes - supported modes
      • getTransferZoneConnectoids

        public Set<DirectedConnectoid> getTransferZoneConnectoids​(TransferZone transferZone)
        Connectoids related to Pt activated modes available for this transfer zone
        Parameters:
        transferZone - to extract for
        Returns:
        known connectoids
      • getGeoIndexedPreExistingTransferZones

        public org.locationtech.jts.index.quadtree.Quadtree getGeoIndexedPreExistingTransferZones()
        Get all the geo indexed transfer zones as a quad tree
        Returns:
        registered geo indexed transfer zones
      • getPreExistingTransferZonesByExternalId

        public Map<String,​TransferZone> getPreExistingTransferZonesByExternalId()
        Get all the existing transfer zones by their external id
        Returns:
        existing transfer zones by external id
      • createGtfsStopToTransferZonesMappingFunction

        public Function<String,​TransferZone> createGtfsStopToTransferZonesMappingFunction()
        Create mapping function while hiding how the mapping is stored
        Returns:
        function that can map GTFS stop ids to transfer zones based on internal state of this data tracker