Class OsmLaneTaggingSchemeHelper

  • Direct Known Subclasses:
    OsmLanesModeTaggingSchemeHelper, OsmModeLanesTaggingSchemeHelper

    public class OsmLaneTaggingSchemeHelper
    extends Object
    The tagging scheme helper is the base class for different lane based tagging schemes. Currently there exist two different type of mode specific lane based tagging schemes namely a ModeLaneBased one and a LaneModeBased one. A good example and comparison of different schemes can be found for buses via https://wiki.openstreetmap.org/wiki/Bus_lanes
    Author:
    markr
    • Field Detail

      • publicServiceVehicleModes

        protected static final Set<String> publicServiceVehicleModes
        track the modes that we support as part of public service vehicle (psv) lanes, currently only bus
      • eligibleOsmModes

        protected final Set<String> eligibleOsmModes
        track the osm modes that we are considering for the lanes:mode:*=* scheme
      • eligiblePublicServiceVehicleModes

        protected final Set<String> eligiblePublicServiceVehicleModes
        track the public service vehicle modes that are eligible for this instance
    • Constructor Detail

      • OsmLaneTaggingSchemeHelper

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

      • requireTaggingSchemeHelper

        protected static boolean requireTaggingSchemeHelper​(OsmNetworkReaderSettings settings,
                                                            MacroscopicNetworkLayer networkLayer)
        Verify if any modes that can be identified via a currently derived tagging scheme are activated via the settings making it worthwhile to utilise the (derived) 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 subset of modes relevant for the layer at hand
        Returns:
        yes, when these modes are activated, false otherwise
      • getEligibleTaggingSchemeHelperModes

        protected static Set<String> getEligibleTaggingSchemeHelperModes​(OsmNetworkReaderSettings settings,
                                                                         MacroscopicNetworkLayer networkLayer)
        collect activated modes that are utilised via all derived tagging schemes. currently we only consider:
        • bus (and therefore psv)
        • bicycle
        • hgv
        Parameters:
        settings - to filter for activated modes only
        networkLayer - to identify subset of modes relevant for the layer at hand
        Returns:
        list os OSM modes that would identify such modes
      • getMappedModesForAvailableKeys

        protected Set<String> getMappedModesForAvailableKeys​(Map<String,​String> tags,
                                                             Map<String,​String> osmModeKeyMap)
        Collect all the mapped OsmModes for keys that are found to be present in the passed in tags map
        Parameters:
        tags - to use
        osmModeKeyMap - to consider
        Returns:
        osmModes for which the modeKeyMap is available (possibly extracted from road mode category when osmModeKeyMap contains a road mode category instead)
      • hasEligibleModes

        public boolean hasEligibleModes()
        Verify if any eligible modes are present
        Returns:
        true when available, false otherwise