Class OsmZoningMainProcessingHandler
- java.lang.Object
-
- de.topobyte.osm4j.core.access.DefaultOsmHandler
-
- org.goplanit.osm.converter.zoning.handler.OsmZoningHandlerBase
-
- org.goplanit.osm.converter.zoning.handler.OsmZoningMainProcessingHandler
-
- All Implemented Interfaces:
de.topobyte.osm4j.core.access.OsmHandler
public class OsmZoningMainProcessingHandler extends OsmZoningHandlerBase
Handler that handles, i.e., converts, nodes, ways, and relations to the relevant transfer zones. This handler conducts the main processing pass whereas there also exist a pre- and post-processing handlers to initialise and finalise the parsing when the ordering of how OSM entities are parsed from file and offered to the handlers do not allow us to parse the OSM data in a single pass due to interdependencies.- Author:
- markr
-
-
Constructor Summary
Constructors Constructor Description OsmZoningMainProcessingHandler(OsmPublicTransportReaderSettings transferSettings, OsmZoningReaderData zoningReaderData, OsmNetworkToZoningReaderData network2ZoningData, PlanitOsmNetwork referenceNetwork, Zoning zoningToPopulate, OsmZoningHandlerProfiler profiler)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
complete()
protected void
extractTransferInfrastructure(de.topobyte.osm4j.core.model.iface.OsmNode osmNode, OsmPtVersionScheme ptVersion, Map<String,String> tags)
extract the transfer infrastructure which will contribute to newly created transfer zones on the zoning instanceprotected void
extractTransferInfrastructure(de.topobyte.osm4j.core.model.iface.OsmWay osmWay, OsmPtVersionScheme ptVersion, Map<String,String> tags)
extract the transfer infrastructure which will contribute to newly created transfer zones on the zoning instancevoid
handle(de.topobyte.osm4j.core.model.iface.OsmNode osmNode)
Construct PLANit nodes/connectoids/transferzones from OSM nodes when relevantvoid
handle(de.topobyte.osm4j.core.model.iface.OsmRelation osmRelation)
void
handle(de.topobyte.osm4j.core.model.iface.OsmWay osmWay)
Parse an OSM way to extract for example platforms, or other transfer zone related geometryprotected void
handleOsmPtRelation(de.topobyte.osm4j.core.model.iface.OsmRelation osmRelation, Map<String,String> tags)
Handle eligible PT OSM relation to either extract an OSM Ptv2 stop area or multipolygon that represents a public transport platformprotected void
handlePtOsmWay(de.topobyte.osm4j.core.model.iface.OsmWay osmWay, OsmPtVersionScheme ptVersion, Map<String,String> tags)
Conduct actual processing of an OSM way that is deemed compatible and contains public transport features that ought to be parsedvoid
initialiseBeforeParsing()
Call this before we parse the OSM network to initialise the handler properlyvoid
reset()
reset the contents, mainly to free up unused resources-
Methods inherited from class org.goplanit.osm.converter.zoning.handler.OsmZoningHandlerBase
getConnectoidHelper, getGeoUtils, getNetworkToZoningData, getProfiler, getPtModeHelper, getReferenceNetwork, getSettings, getTransferZoneGroupHelper, getTransferZoneHelper, getZoning, getZoningReaderData, hasNetworkLayersWithActiveOsmNode, isActivatedPublicTransportInfrastructure, isCoveredByZoningBoundingPolygon, isCoveredByZoningBoundingPolygon, isNearNetworkBoundingBox, logWarningIfNotNearBoundingBox, skipOsmNode, skipOsmPtEntity, skipOsmWay, wrapHandlePtOsmNode, wrapHandlePtOsmRelation, wrapHandlePtOsmWay
-
-
-
-
Constructor Detail
-
OsmZoningMainProcessingHandler
public OsmZoningMainProcessingHandler(OsmPublicTransportReaderSettings transferSettings, OsmZoningReaderData zoningReaderData, OsmNetworkToZoningReaderData network2ZoningData, PlanitOsmNetwork referenceNetwork, Zoning zoningToPopulate, OsmZoningHandlerProfiler profiler)
Constructor- Parameters:
transferSettings
- for the handlerzoningReaderData
- gather data during parsing and utilise available data from pre-processingnetwork2ZoningData
- data transferred from parsing network to be used by zoning reader.referenceNetwork
- to usezoningToPopulate
- to populateprofiler
- to use
-
-
Method Detail
-
extractTransferInfrastructure
protected void extractTransferInfrastructure(de.topobyte.osm4j.core.model.iface.OsmNode osmNode, OsmPtVersionScheme ptVersion, Map<String,String> tags)
extract the transfer infrastructure which will contribute to newly created transfer zones on the zoning instance- Parameters:
osmNode
- to parseptVersion
- this node adheres totags
- to use
-
extractTransferInfrastructure
protected void extractTransferInfrastructure(de.topobyte.osm4j.core.model.iface.OsmWay osmWay, OsmPtVersionScheme ptVersion, Map<String,String> tags)
extract the transfer infrastructure which will contribute to newly created transfer zones on the zoning instance- Parameters:
osmWay
- to parseptVersion
- this way adheres totags
- to use
-
handlePtOsmWay
protected void handlePtOsmWay(de.topobyte.osm4j.core.model.iface.OsmWay osmWay, OsmPtVersionScheme ptVersion, Map<String,String> tags)
Conduct actual processing of an OSM way that is deemed compatible and contains public transport features that ought to be parsed- Parameters:
osmWay
- to parseptVersion
- identified for this OSM waytags
- of this OSM way
-
handleOsmPtRelation
protected void handleOsmPtRelation(de.topobyte.osm4j.core.model.iface.OsmRelation osmRelation, Map<String,String> tags)
Handle eligible PT OSM relation to either extract an OSM Ptv2 stop area or multipolygon that represents a public transport platform- Parameters:
osmRelation
- to handletags
- of the relation
-
initialiseBeforeParsing
public void initialiseBeforeParsing()
Call this before we parse the OSM network to initialise the handler properly- Specified by:
initialiseBeforeParsing
in classOsmZoningHandlerBase
-
handle
public void handle(de.topobyte.osm4j.core.model.iface.OsmNode osmNode)
Construct PLANit nodes/connectoids/transferzones from OSM nodes when relevant- Specified by:
handle
in interfacede.topobyte.osm4j.core.access.OsmHandler
- Overrides:
handle
in classde.topobyte.osm4j.core.access.DefaultOsmHandler
- Parameters:
osmNode
- node to parse
-
handle
public void handle(de.topobyte.osm4j.core.model.iface.OsmWay osmWay)
Parse an OSM way to extract for example platforms, or other transfer zone related geometry- Specified by:
handle
in interfacede.topobyte.osm4j.core.access.OsmHandler
- Overrides:
handle
in classde.topobyte.osm4j.core.access.DefaultOsmHandler
- Parameters:
osmWay
- to handle
-
handle
public void handle(de.topobyte.osm4j.core.model.iface.OsmRelation osmRelation)
- Specified by:
handle
in interfacede.topobyte.osm4j.core.access.OsmHandler
- Overrides:
handle
in classde.topobyte.osm4j.core.access.DefaultOsmHandler
-
complete
public void complete() throws IOException
- Specified by:
complete
in interfacede.topobyte.osm4j.core.access.OsmHandler
- Overrides:
complete
in classde.topobyte.osm4j.core.access.DefaultOsmHandler
- Throws:
IOException
-
reset
public void reset()
reset the contents, mainly to free up unused resources- Specified by:
reset
in classOsmZoningHandlerBase
-
-