Class OsmLanesModeTaggingSchemeHelper


  • public class OsmLanesModeTaggingSchemeHelper
    extends OsmLaneTaggingSchemeHelper
    The lanesMode tagging scheme is one of a number of tagging schemes used by OSM to identify dedicated lanes for specific modes. It does not allow to identify which of the lanes belongs to a mode but it does allow one to identify how many lanes (and possibly 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 lanes:<mode>:*=* 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

      • lanesModeKeyTags

        protected Map<String,​String> lanesModeKeyTags
        lanes:<mode> tags
      • lanesModeForwardKeyTags

        protected final Map<String,​String> lanesModeForwardKeyTags
        lanes:<mode>:forward tags
      • lanesModeBackwardKeyTags

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

      • OsmLanesModeTaggingSchemeHelper

        public OsmLanesModeTaggingSchemeHelper​(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 lanes:<mode> tagging scheme are currently activated via the settings making it worthwhile to utilise this tagging scheme. Note that if the passed in layer does not support the activated PLANit mode the helper is not required either, since the layer will not support any of these modes. 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
      • getEligibleLanesModeSchemeHelperModes

        public static Set<String> getEligibleLanesModeSchemeHelperModes​(OsmNetworkReaderSettings settings,
                                                                        MacroscopicNetworkLayer networkLayer)
        collect activated modes that can be identified via the lanes:<mode> 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 restrict the eligible modes based on the modes supported by the layer
        Returns:
        list os 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 without any further direction information via the lanes:<mode> mode tags
        Parameters:
        tags - to use
        isForwardDirection - when true explore only forward direction, when false only backward direction
        Returns:
        modes with lanes in direction indicated