Class OsmNetworkHandlerHelper


  • public class OsmNetworkHandlerHelper
    extends Object
    Helper class for the OSM network handlers, providing static helper methods that reflect common code across various handlers that are not considered general enough to be part of a utility class.
    Author:
    markr
    • Field Detail

      • LOGGER

        public static final Logger LOGGER
        the logger to use
      • LINK_OSMWAY_TYPE_PROPERTY_KEY

        protected static final String LINK_OSMWAY_TYPE_PROPERTY_KEY
        to be able to retain the information on the osm way type to be able to identify the importance of an osm way compared to others we use the osm way type and store it as an input property on the link using this key
        See Also:
        Constant Field Values
      • LINK_OSM_LAYER_PROPERTY_KEY

        protected static final String LINK_OSM_LAYER_PROPERTY_KEY
        to be able to retain the information on the vertical layer index so we can map it to infrastructure at the same index level we store it as an input property on the link using this key
        See Also:
        Constant Field Values
    • Constructor Detail

      • OsmNetworkHandlerHelper

        public OsmNetworkHandlerHelper()
    • Method Detail

      • setLinkOsmWayType

        public static void setLinkOsmWayType​(Link link,
                                             String osmWayType)
        set the OSM way type
        Parameters:
        link - to set for
        osmWayType - to use
      • getLinkOsmWayType

        public static String getLinkOsmWayType​(Link link)
        Collect the OSM way type of the link
        Parameters:
        link - to collect from
        Returns:
        osm way type, null if not present
      • getLinkVerticalLayerIndex

        public static int getLinkVerticalLayerIndex​(Link link)
        Collect the OSM vertical layer index for the link
        Parameters:
        link - to collect from
        Returns:
        vertical layer index, defaults to 0 if not explicitly registered
      • getMostFrequentVerticalLayerIndex

        public static int getMostFrequentVerticalLayerIndex​(Collection<? extends Link> links)
        Collect the OSM vertical layer index across the given links that occurs most frequenctly
        Parameters:
        links - to base
        Returns:
        vertical layer index chosen, defaults to 0 if not explicitly registered
      • setLinkVerticalLayerIndex

        public static void setLinkVerticalLayerIndex​(MacroscopicLink link,
                                                     Map<String,​String> tags)
        Set the OSM vertical layer index for the link based on its OSM tags
        Parameters:
        link - to set index for
        tags - to extract index from, if absent, OSM default of 0 is implicitly assumed