Class GtfsZoningHandlerData


  • public class GtfsZoningHandlerData
    extends GtfsConverterHandlerData
    Track data used during handling/parsing of GTFS Stops which end up being converted into PLANit transfer zones
    Author:
    markr
    • Method Detail

      • initialise

        protected void initialise()
        Initialise the tracking of data
      • getSupportedPtModes

        public List<Mode> getSupportedPtModes​(GtfsStop gtfsStop)
        Collect the mapped PLANit pt mode using this GTFS stop
        Parameters:
        gtfsStop - to collect PLANit mode for
        Returns:
        found PLANit modes, or null if none is found
      • getZoning

        public Zoning getZoning()
        Access to the zoning to populate
        Returns:
        zoning to populate (further)
      • getRoutedServices

        public RoutedServices getRoutedServices()
        Access to the routed services container
        Returns:
        the routed services being populated
      • getGeoTools

        public PlanitJtsCrsUtils getGeoTools()
        Get geo tools to provide PLANit related GIS functionality
        Returns:
        geo tools
      • getCrsTransform

        public org.opengis.referencing.operation.MathTransform getCrsTransform()
        Get Math transform to apply on the fly transformations for the CRS at hand
        Returns:
        transformation
      • getGeoIndexedLinks

        public org.locationtech.jts.index.quadtree.Quadtree getGeoIndexedLinks()
        Get all the geo indexed links as a quad tree
        Returns:
        registered geo indexed links
      • removeGeoIndexedLink

        public void removeGeoIndexedLink​(MacroscopicLink link)
        Remove link from local spatial index based on links
        Parameters:
        link - to remove
      • addGeoIndexedLink

        public void addGeoIndexedLink​(MacroscopicLink link)
        Add provided link to local spatial index based on their bounding box
        Parameters:
        link - to add
      • addGeoIndexedLinks

        public void addGeoIndexedLinks​(MacroscopicLink... links)
        Add provided link to local spatial index based on their bounding box
        Parameters:
        links - to add
      • getReferenceNetworkBoundingBox

        public org.locationtech.jts.geom.Envelope getReferenceNetworkBoundingBox()
        Returns:
        bounding box of used reference network
      • getDirectedConnectoidsByLocation

        public Map<org.locationtech.jts.geom.Point,​List<DirectedConnectoid>> getDirectedConnectoidsByLocation​(MacroscopicNetworkLayer networkLayer)
        collect the registered connectoids indexed by their locations for a given network layer (unmodifiable)
        Parameters:
        networkLayer - to use
        Returns:
        registered directed connectoids indexed by location
      • getDirectedConnectoidsByLocation

        public List<DirectedConnectoid> getDirectedConnectoidsByLocation​(org.locationtech.jts.geom.Point nodeLocation,
                                                                         MacroscopicNetworkLayer networkLayer)
        Collect the registered connectoids by given locations and network layer (unmodifiable)
        Parameters:
        nodeLocation - to verify
        networkLayer - to extract from
        Returns:
        found connectoids (if any), otherwise null or empty set
      • addDirectedConnectoidByLocation

        public boolean addDirectedConnectoidByLocation​(MacroscopicNetworkLayer networkLayer,
                                                       org.locationtech.jts.geom.Point connectoidLocation,
                                                       DirectedConnectoid connectoid)
        Add a connectoid to the registered connectoids indexed by their OSM id
        Parameters:
        networkLayer - to register for
        connectoidLocation - this connectoid relates to
        connectoid - to add
        Returns:
        true when successful, false otherwise
      • hasAnyDirectedConnectoidsForLocation

        public boolean hasAnyDirectedConnectoidsForLocation​(org.locationtech.jts.geom.Point location)
        Check if any connectoids have been registered for the given location on any layer
        Parameters:
        location - to verify
        Returns:
        true when present, false otherwise
      • hasDirectedConnectoidForLocation

        public boolean hasDirectedConnectoidForLocation​(NetworkLayer networkLayer,
                                                        org.locationtech.jts.geom.Point point)
        Check if any connectoid has been registered for the given location for this layer
        Parameters:
        networkLayer - to check for
        point - to use
        Returns:
        true when present, false otherwise
      • 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 mode as supported on the PLANit transfer zone (if not already present)
        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,
                                                          Set<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
      • createGtfsStopToTransferZoneMappingFunction

        public Function<String,​TransferZone> createGtfsStopToTransferZoneMappingFunction()
        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