Class OsmZoningPreProcessingHandler
- java.lang.Object
-
- de.topobyte.osm4j.core.access.DefaultOsmHandler
-
- org.goplanit.osm.converter.zoning.handler.OsmZoningHandlerBase
-
- org.goplanit.osm.converter.zoning.handler.OsmZoningPreProcessingHandler
-
- All Implemented Interfaces:
de.topobyte.osm4j.core.access.OsmHandler
public class OsmZoningPreProcessingHandler extends OsmZoningHandlerBase
Handler that is applied before we conduct the actual handling of the zones by exploring the OSM relations in the file and highlighting a subset of ways that we are supposed to retain even though they are not tagged by themselves in a way that warrants keeping them. However, because they are vital to the OSM relations we should keep them.To avoid keeping all ways and nodes in memory, we preprocess by first identifying which nodes/ways we must keep to be able to properly parse the OSM relations (that are always parsed last).
Run pre-processing twice, first stage with IDENTIFY_PLATFORM_AS_RELATIONS, then when these platforms have been identified run again with IDENTIFY_PT_NODES which will pre-register all nodes for the ways that were identified as platform AND will pre-register all remaining unregistered OSM nodes part of relations that are not part of the physical network, such as station nodes
- Author:
- markr
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OsmZoningPreProcessingHandler.Stage
Preprocessing of platform relations has two stages, identified by this enum
-
Constructor Summary
Constructors Constructor Description OsmZoningPreProcessingHandler(PlanitOsmNetwork referenceNetwork, Zoning zoningToPopulate, OsmPublicTransportReaderSettings transferSettings, OsmZoningReaderData zoningReaderData, OsmNetworkToZoningReaderData network2ZoningData, OsmZoningPreProcessingHandler.Stage stage, OsmZoningHandlerProfiler profiler)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
complete()
void
handle(de.topobyte.osm4j.core.model.iface.OsmRelation osmRelation)
void
handle(de.topobyte.osm4j.core.model.iface.OsmWay osmWay)
void
initialiseBeforeParsing()
Call this BEFORE we apply the handlervoid
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
-
OsmZoningPreProcessingHandler
public OsmZoningPreProcessingHandler(PlanitOsmNetwork referenceNetwork, Zoning zoningToPopulate, OsmPublicTransportReaderSettings transferSettings, OsmZoningReaderData zoningReaderData, OsmNetworkToZoningReaderData network2ZoningData, OsmZoningPreProcessingHandler.Stage stage, OsmZoningHandlerProfiler profiler)
Constructor- Parameters:
referenceNetwork
- to usezoningToPopulate
- to populatetransferSettings
- for the handlerzoningReaderData
- to use for storage of temporary information, or data that is to be made available to later handlersnetwork2ZoningData
- data transferred from parsing network to be used by zoning reader.stage
- indicating what stage this pre-processing is in.Depending on the stage different pre-processing actinos are undertakenprofiler
- to use
-
-
Method Detail
-
initialiseBeforeParsing
public void initialiseBeforeParsing()
Call this BEFORE we apply the handler- Specified by:
initialiseBeforeParsing
in classOsmZoningHandlerBase
-
handle
public void handle(de.topobyte.osm4j.core.model.iface.OsmWay osmWay)
- Specified by:
handle
in interfacede.topobyte.osm4j.core.access.OsmHandler
- Overrides:
handle
in classde.topobyte.osm4j.core.access.DefaultOsmHandler
-
handle
public void handle(de.topobyte.osm4j.core.model.iface.OsmRelation osmRelation) throws IOException
- Specified by:
handle
in interfacede.topobyte.osm4j.core.access.OsmHandler
- Overrides:
handle
in classde.topobyte.osm4j.core.access.DefaultOsmHandler
- Throws:
IOException
-
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
-
-