Class OsmNetworkLayerModeParser
- java.lang.Object
-
- org.goplanit.osm.converter.helper.OsmModeHelper
-
- org.goplanit.osm.converter.network.OsmNetworkLayerModeParser
-
public class OsmNetworkLayerModeParser extends OsmModeHelper
Class to support parsing of OSM modes on OSM ways given the configuration provided for each PLANit network layer- Author:
- markr
-
-
Constructor Summary
Constructors Constructor Description OsmNetworkLayerModeParser(OsmNetworkReaderSettings settings, MacroscopicNetworkLayer networkLayer)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<Mode>
getExplicitlyExcludedModes(Map<String,String> tags, boolean isForwardDirection, OsmNetworkReaderSettings settings)
Collect explicitly excluded modes from the passed in tags.Set<Mode>
getExplicitlyIncludedModes(Map<String,String> tags, boolean isForwardDirection, OsmNetworkReaderSettings settings)
Collect explicitly included modes from the passed in tags.void
updateAccessKeyBasedModeRestrictions(Map<String,String> tags, Set<Mode> includedModesToUpdate, Set<Mode> excludedModesToUpdate)
Update the included and excluded mode sets passed in based on the key/value information available in the access=? tag.-
Methods inherited from class org.goplanit.osm.converter.helper.OsmModeHelper
filterModeCompatibleLinks, getSettings, isLinkModeCompatible, isModeCompatible
-
-
-
-
Constructor Detail
-
OsmNetworkLayerModeParser
public OsmNetworkLayerModeParser(OsmNetworkReaderSettings settings, MacroscopicNetworkLayer networkLayer)
Constructor- Parameters:
settings
- to usenetworkLayer
- this parser is applied to
-
-
Method Detail
-
getExplicitlyIncludedModes
public Set<Mode> getExplicitlyIncludedModes(Map<String,String> tags, boolean isForwardDirection, OsmNetworkReaderSettings settings)
Collect explicitly included modes from the passed in tags. Given the many ways this can be tagged we distinguish between:- mode inclusions agnostic to the way being tagged as oneway or not
getExplicitlyIncludedModesOneWayAgnostic(java.util.Map<java.lang.String,java.lang.String>,boolean)
- mode inclusions when way is tagged as oneway and exploring the one way direction
getExplicitlyIncludedModesOneWayMainDirection(java.util.Map<java.lang.String,java.lang.String>)
- mode inclusions when way is tagged as oneway and exploring the opposite direction of oneway direction
getExplicitlyIncludedModesOneWayOppositeDirection(java.util.Map<java.lang.String,java.lang.String>)
- mode inclusions when we are NOT exploring the opposite direction of a oneway when present, e.g., either main direction of one way, or non-oneway
getExplicitlyIncludedModesTwoWayForLocation(java.util.Map<java.lang.String,java.lang.String>,boolean)
- Parameters:
tags
- to find explicitly included (planit) modes fromisForwardDirection
- flag indicating if we are conducting this method in forward direction or not (forward being in the direction of how the geometry is provided)settings
- to access mapping from osm mdoes to planit modes- Returns:
- the included planit modes supported by the parser in the designated direction
- mode inclusions agnostic to the way being tagged as oneway or not
-
getExplicitlyExcludedModes
public Set<Mode> getExplicitlyExcludedModes(Map<String,String> tags, boolean isForwardDirection, OsmNetworkReaderSettings settings)
Collect explicitly excluded modes from the passed in tags. Given the many ways this can be tagged we distinguish between:- mode exclusions agnostic to the way being tagged as oneway or not
getExplicitlyExcludedModesOneWayAgnostic(java.util.Map<java.lang.String,java.lang.String>,boolean,org.goplanit.osm.converter.network.OsmNetworkReaderSettings)
- mode exclusions when way is tagged as oneway and exploring the one way direction
getExplicitlyExcludedModesOneWayMainDirection(java.util.Map<java.lang.String,java.lang.String>)
- mode exclusions when way is tagged as oneway and exploring the opposite direction of oneway direction
getExplicitlyExcludedModesOneWayOppositeDirection()
- Parameters:
tags
- to find explicitly included (planit) modes fromisForwardDirection
- flag indicating if we are conducting this method in forward direction or not (forward being in the direction of how the geometry is provided)settings
- required for access to mode mapping between osm modes and PLANit modes- Returns:
- the included planit modes supported by the parser in the designated direction
- mode exclusions agnostic to the way being tagged as oneway or not
-
updateAccessKeyBasedModeRestrictions
public void updateAccessKeyBasedModeRestrictions(Map<String,String> tags, Set<Mode> includedModesToUpdate, Set<Mode> excludedModesToUpdate)
Update the included and excluded mode sets passed in based on the key/value information available in the access=? tag.- Parameters:
tags
- where we extract the access information fromincludedModesToUpdate
- the set to supplement with found access information of allowed modes, e.g. access=yes, access=bus, etc.excludedModesToUpdate
- the set to supplement with found access information of disallowed modes, e.g. access=no, etc.
-
-