Class OsmNetworkPreProcessingHandler
- java.lang.Object
-
- de.topobyte.osm4j.core.access.DefaultOsmHandler
-
- org.goplanit.osm.converter.network.OsmNetworkBaseHandler
-
- org.goplanit.osm.converter.network.OsmNetworkPreProcessingHandler
-
- All Implemented Interfaces:
de.topobyte.osm4j.core.access.OsmHandler
public class OsmNetworkPreProcessingHandler extends OsmNetworkBaseHandler
Preprocessing Handler that identifies which nodes of osm ways - that are marked for inclusion even if they fall (partially) outside the bounding polygon - are to be kept. Since we only know what nodes these are after parsing OSM ways (and nodes are parsed before the ways), this pre-processing is the only way that we can identify these nodes before the main parsing pass.- Author:
- markr
-
-
Constructor Summary
Constructors Constructor Description OsmNetworkPreProcessingHandler(PlanitOsmNetwork networkToPopulate, OsmNetworkReaderData networkData, OsmNetworkReaderSettings settings)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
complete()
Log total number of parsed nodes and percentage retainedvoid
handle(de.topobyte.osm4j.core.model.iface.OsmNode node)
Count total number of nodes in OSM filevoid
handle(de.topobyte.osm4j.core.model.iface.OsmWay osmWay)
for all OSM ways that are explicitly marked for inclusion despite falling outside the bounding polygon we extract their nodes and mark them for inclusion as exceptions to the bounding polygon filter that is applied during the main parsing pass in the regular PlanitOsmNetworkHandlerprotected void
handleEligibleOsmWay(de.topobyte.osm4j.core.model.iface.OsmWay osmWay, Map<String,String> tags)
Mark all nodes of eligible OSM ways (e.g., road, rail, etc.) to be parsed during the main processing phasevoid
reset()
reset the contents, mainly to free up unused resources-
Methods inherited from class org.goplanit.osm.converter.network.OsmNetworkBaseHandler
getNetwork, getNetworkData, getSettings, isActivatedRoadRailOrWaterwayBasedInfrastructure, wrapHandleOsmWay
-
-
-
-
Constructor Detail
-
OsmNetworkPreProcessingHandler
public OsmNetworkPreProcessingHandler(PlanitOsmNetwork networkToPopulate, OsmNetworkReaderData networkData, OsmNetworkReaderSettings settings)
Constructor- Parameters:
networkToPopulate
- the network to populatenetworkData
- to populatesettings
- for the handler
-
-
Method Detail
-
handleEligibleOsmWay
protected void handleEligibleOsmWay(de.topobyte.osm4j.core.model.iface.OsmWay osmWay, Map<String,String> tags)
Mark all nodes of eligible OSM ways (e.g., road, rail, etc.) to be parsed during the main processing phase- Parameters:
osmWay
- to handletags
- of the OSM way
-
handle
public void handle(de.topobyte.osm4j.core.model.iface.OsmNode node)
Count total number of nodes in OSM file- 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.OsmWay osmWay)
for all OSM ways that are explicitly marked for inclusion despite falling outside the bounding polygon we extract their nodes and mark them for inclusion as exceptions to the bounding polygon filter that is applied during the main parsing pass in the regular PlanitOsmNetworkHandler- 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
Log total number of parsed nodes and percentage retained- 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- Overrides:
reset
in classOsmNetworkBaseHandler
-
-