Class OsmNetworkBaseHandler
- java.lang.Object
-
- de.topobyte.osm4j.core.access.DefaultOsmHandler
-
- org.goplanit.osm.converter.network.OsmNetworkBaseHandler
-
- All Implemented Interfaces:
de.topobyte.osm4j.core.access.OsmHandler
- Direct Known Subclasses:
OsmNetworkMainProcessingHandler,OsmNetworkPreProcessingHandler
public abstract class OsmNetworkBaseHandler extends de.topobyte.osm4j.core.access.DefaultOsmHandlerBase handler for networks with common functionality. Requires derived hanlder for concrete implementation.- Author:
- markr
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedOsmNetworkBaseHandler(PlanitOsmNetwork networkToPopulate, OsmNetworkReaderData networkData, OsmNetworkReaderSettings settings)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PlanitOsmNetworkgetNetwork()protected OsmNetworkReaderDatagetNetworkData()protected OsmNetworkReaderSettingsgetSettings()protected booleanisActivatedRoadRailOrWaterwayBasedInfrastructure(Map<String,String> tags)verify if tags represent an highway or railway that is specifically aimed at road based or rail based infrastructure, e.g., asphalt or tracks and NOT an area, platform, stops, etc.voidreset()reset the contents, mainly to free up unused resourcesprotected voidwrapHandleOsmWay(de.topobyte.osm4j.core.model.iface.OsmWay osmWay, BiConsumer<de.topobyte.osm4j.core.model.iface.OsmWay,Map<String,String>> osmWayConsumer)Wrap the handling of OSM way by checking if it is eligible and catch any run time PLANit exceptions, if eligible delegate to consumer.
-
-
-
Constructor Detail
-
OsmNetworkBaseHandler
protected OsmNetworkBaseHandler(PlanitOsmNetwork networkToPopulate, OsmNetworkReaderData networkData, OsmNetworkReaderSettings settings)
Constructor- Parameters:
networkToPopulate- to populatenetworkData- to usesettings- for the handler
-
-
Method Detail
-
isActivatedRoadRailOrWaterwayBasedInfrastructure
protected boolean isActivatedRoadRailOrWaterwayBasedInfrastructure(Map<String,String> tags)
verify if tags represent an highway or railway that is specifically aimed at road based or rail based infrastructure, e.g., asphalt or tracks and NOT an area, platform, stops, etc. and is also activated for parsing based on the settings- Parameters:
tags- to verify- Returns:
- true when activated and highway or railway (not an area), false otherwise
-
wrapHandleOsmWay
protected void wrapHandleOsmWay(de.topobyte.osm4j.core.model.iface.OsmWay osmWay, BiConsumer<de.topobyte.osm4j.core.model.iface.OsmWay,Map<String,String>> osmWayConsumer)Wrap the handling of OSM way by checking if it is eligible and catch any run time PLANit exceptions, if eligible delegate to consumer.- Parameters:
osmWay- to parseosmWayConsumer- to apply to eligible OSM way
-
getSettings
protected OsmNetworkReaderSettings getSettings()
-
getNetworkData
protected OsmNetworkReaderData getNetworkData()
-
getNetwork
protected PlanitOsmNetwork getNetwork()
-
reset
public void reset()
reset the contents, mainly to free up unused resources
-
-