Class OsmNetworkHandlerHelper
- java.lang.Object
-
- org.goplanit.osm.converter.network.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 Summary
Fields Modifier and Type Field Description protected static 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 keyprotected static 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 keystatic Logger
LOGGER
the logger to use
-
Constructor Summary
Constructors Constructor Description OsmNetworkHandlerHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addAllTo(Map<Long,Set<MacroscopicLink>> addition, Map<Long,Set<MacroscopicLink>> destination)
add addition to destinationstatic String
getLinkOsmWayType(Link link)
Collect the OSM way type of the linkstatic int
getLinkVerticalLayerIndex(Link link)
Collect the OSM vertical layer index for the linkstatic int
getMostFrequentVerticalLayerIndex(Collection<? extends Link> links)
Collect the OSM vertical layer index across the given links that occurs most frequenctlystatic void
setLinkOsmWayType(Link link, String osmWayType)
set the OSM way typestatic void
setLinkVerticalLayerIndex(MacroscopicLink link, Map<String,String> tags)
Set the OSM vertical layer index for the link based on its OSM tags
-
-
-
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
-
-
Method Detail
-
setLinkOsmWayType
public static void setLinkOsmWayType(Link link, String osmWayType)
set the OSM way type- Parameters:
link
- to set forosmWayType
- 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 fortags
- to extract index from, if absent, OSM default of 0 is implicitly assumed
-
addAllTo
public static void addAllTo(Map<Long,Set<MacroscopicLink>> addition, Map<Long,Set<MacroscopicLink>> destination)
add addition to destination- Parameters:
addition
- to adddestination
- to add to
-
-