Class OsmModeLanesTaggingSchemeHelper


  • public class OsmModeLanesTaggingSchemeHelper
    extends OsmLaneTaggingSchemeHelper
    The modeLanes tagging scheme is one of a number of tagging schemes used by OSM to identify dedicated lanes for specific modes. It allows to identify which and how many lanes (and indirectly in what direction) are dedicated to a mode. A good example and comparison of different schemes can be found for buses via https://wiki.openstreetmap.org/wiki/Bus_lanes

    Methods that help identify modes specified using the <mode>:lanes:*=* scheme. since this scheme applies across a number of modes it is useful to group the functionality in a separate class

    Author:
    markr
    • Field Detail

      • modeLanesKeyTags

        protected final Map<String,​String> modeLanesKeyTags
        <mode>:lanes tags
      • modeLanesForwardKeyTags

        protected final Map<String,​String> modeLanesForwardKeyTags
        <mode>:lanes:forward tags
      • modeLanesBackwardKeyTags

        protected final Map<String,​String> modeLanesBackwardKeyTags
        <mode>:lanes:backward tags
    • Constructor Detail

      • OsmModeLanesTaggingSchemeHelper

        public OsmModeLanesTaggingSchemeHelper​(Set<String> theEligibleOsmModes)
        Constructor
        Parameters:
        theEligibleOsmModes - (or road mode categories) to consider for the lane modes scheme
    • Method Detail

      • requireLanesModeSchemeHelper

        public static boolean requireLanesModeSchemeHelper​(OsmNetworkReaderSettings settings,
                                                           MacroscopicNetworkLayer networkLayer)
        Verify if any modes that can be identified via the <mode>:lanes tagging scheme are currently activated via the settings making it worthwhile to utilise this tagging scheme. Currently we only consider:
        • bus (and therefore psv)
        • bicycle
        • hgv
        Parameters:
        settings - containing the activated and mapped OSM to PLANit modes
        networkLayer - to identify supported modes on the layer, which is a subset of all mapped modes
        Returns:
        yes, when these modes are activated, false otherwise
      • getEligibleModeLanesSchemeHelperModes

        public static Set<String> getEligibleModeLanesSchemeHelperModes​(OsmNetworkReaderSettings settings,
                                                                        MacroscopicNetworkLayer networkLayer)
        collect activated modes(and their mode categories) that can be identified via the <mode>:lanes tagging scheme are currently supported. currently we only consider:
        • bus (and therefore psv)
        • bicycle
        • hgv
        Parameters:
        settings - to filter for activated modes only
        networkLayer - to identify supported modes on the layer, which is a subset of all mapped modes
        Returns:
        list of OSM modes that would identify such modes
      • getModesWithLanesWithoutDirection

        public Set<String> getModesWithLanesWithoutDirection​(Map<String,​String> tags)
        Collect the registered eligible OSM modes with lanes present without any further direction information via the lanes:<mode> mode tags
        Parameters:
        tags - to use
        Returns:
        modes found
      • getModesWithLanesInDirection

        public Set<String> getModesWithLanesInDirection​(Map<String,​String> tags,
                                                        boolean isForwardDirection)
        collect the registered eligible OSM modes with lanes present for a particular direction via the lanes:<mode> mode tags
        Parameters:
        tags - to use
        isForwardDirection - when true explore only forward direction, when false only backward direction
        Returns:
        modes in given direction