Class GtfsZoningHandlerData
- java.lang.Object
-
- org.goplanit.gtfs.converter.GtfsConverterHandlerData
-
- org.goplanit.gtfs.converter.zoning.handler.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
-
-
Constructor Summary
Constructors Constructor Description GtfsZoningHandlerData(GtfsZoningReaderSettings settings, Zoning zoningToPopulate, ServiceNetwork serviceNetwork, RoutedServices routedServices, GtfsZoningHandlerProfiler handlerProfiler)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addDirectedConnectoidByLocation(MacroscopicNetworkLayer networkLayer, org.locationtech.jts.geom.Point connectoidLocation, DirectedConnectoid connectoid)
Add a connectoid to the registered connectoids indexed by their OSM idvoid
addGeoIndexedLink(MacroscopicLink link)
Add provided link to local spatial index based on their bounding boxvoid
addGeoIndexedLinks(MacroscopicLink... links)
Add provided link to local spatial index based on their bounding boxFunction<String,TransferZone>
createGtfsStopToTransferZoneMappingFunction()
Create mapping function while hiding how the mapping is storedorg.opengis.referencing.operation.MathTransform
getCrsTransform()
Get Math transform to apply on the fly transformations for the CRS at handMap<org.locationtech.jts.geom.Point,List<DirectedConnectoid>>
getDirectedConnectoidsByLocation(MacroscopicNetworkLayer networkLayer)
collect the registered connectoids indexed by their locations for a given network layer (unmodifiable)List<DirectedConnectoid>
getDirectedConnectoidsByLocation(org.locationtech.jts.geom.Point nodeLocation, MacroscopicNetworkLayer networkLayer)
Collect the registered connectoids by given locations and network layer (unmodifiable)org.locationtech.jts.index.quadtree.Quadtree
getGeoIndexedLinks()
Get all the geo indexed links as a quad treeorg.locationtech.jts.index.quadtree.Quadtree
getGeoIndexedPreExistingTransferZones()
Get all the geo indexed transfer zones as a quad treePlanitJtsCrsUtils
getGeoTools()
Get geo tools to provide PLANit related GIS functionalityGtfsStop
getMappedGtfsStop(String gtfsStopId)
Retrieve a GTFS stop that has been mapped to a pre-existing PLANit transfer zoneTransferZone
getMappedTransferZone(GtfsStop gtfsStop)
Get the transfer zone that the GTFS stop was already mapped to (if any)Map<String,TransferZone>
getPreExistingTransferZonesByExternalId()
Get all the existing transfer zones by their external idGtfsZoningHandlerProfiler
getProfiler()
Access to profilerorg.locationtech.jts.geom.Envelope
getReferenceNetworkBoundingBox()
RoutedServices
getRoutedServices()
Access to the routed services containerGtfsZoningReaderSettings
getSettings()
Access to GTFS zoning reader settingsList<Mode>
getSupportedPtModes(GtfsStop gtfsStop)
Collect the mapped PLANit pt mode using this GTFS stopSet<Mode>
getSupportedPtModesIn(TransferZone planitTransferZone, Set<Mode> modesFilter)
The pt services modes supported on the given transfer zoneSet<DirectedConnectoid>
getTransferZoneConnectoids(TransferZone transferZone)
Connectoids related to Pt activated modes available for this transfer zoneZoning
getZoning()
Access to the zoning to populateboolean
hasAnyDirectedConnectoidsForLocation(org.locationtech.jts.geom.Point location)
Check if any connectoids have been registered for the given location on any layerboolean
hasDirectedConnectoidForLocation(NetworkLayer networkLayer, org.locationtech.jts.geom.Point point)
Check if any connectoid has been registered for the given location for this layerboolean
hasMappedGtfsStop(TransferZone transferZone)
Check if transfer zone already has a mapped GTFS stopprotected void
initialise()
Initialise the tracking of datavoid
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)void
registerTransferZoneToConnectoidModes(TransferZone transferZone, DirectedConnectoid directedConnectoid, Set<Mode> activatedPlanitModes)
Update registered and activated pt modes and their access information on transfer zonevoid
removeGeoIndexedLink(MacroscopicLink link)
Remove link from local spatial index based on links-
Methods inherited from class org.goplanit.gtfs.converter.GtfsConverterHandlerData
expandWithCompatibleModes, getActivatedPlanitModesByGtfsMode, getCompatiblePlanitModesIfActivated, getCompatiblePlanitModesIfActivated, getPrimaryPlanitModeIfActivated, getServiceNetwork
-
-
-
-
Constructor Detail
-
GtfsZoningHandlerData
public GtfsZoningHandlerData(GtfsZoningReaderSettings settings, Zoning zoningToPopulate, ServiceNetwork serviceNetwork, RoutedServices routedServices, GtfsZoningHandlerProfiler handlerProfiler)
Constructor- Parameters:
settings
- to usezoningToPopulate
- the zoning to populateserviceNetwork
- to useroutedServices
- to usehandlerProfiler
- to use
-
-
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
-
getProfiler
public GtfsZoningHandlerProfiler getProfiler()
Access to profiler- Returns:
- profiler
-
getSettings
public GtfsZoningReaderSettings getSettings()
Access to GTFS zoning reader settings- Overrides:
getSettings
in classGtfsConverterHandlerData
- Returns:
- user configuration settings
-
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 verifynetworkLayer
- 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 forconnectoidLocation
- this connectoid relates toconnectoid
- 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 forpoint
- 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 zonetransferZone
- 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 formodesFilter
- 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 fordirectedConnectoid
- to extract access information fromactivatedPlanitModes
- 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
-
-