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_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<Link>> addition, Map<Long,Set<Link>> destination)
add addition to destinationstatic Map<Long,Set<Link>>
breakLinksWithInternalNode(Node theNode, List<Link> linksToBreak, MacroscopicNetworkLayer networkLayer, org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Check if we should break any links for the passed in node and if so, do itstatic Node
createAndPopulateNode(de.topobyte.osm4j.core.model.iface.OsmNode osmNode, MacroscopicNetworkLayer networkLayer)
Extract a PLANit node from the osmNode informationstatic Node
createAndPopulateNode(org.locationtech.jts.geom.Point geometry, MacroscopicNetworkLayer networkLayer)
Extract a PLANit node from the osmNode informationstatic Node
createPopulateAndRegisterNode(de.topobyte.osm4j.core.model.iface.OsmNode osmNode, MacroscopicNetworkLayer networkLayer, OsmNetworkReaderLayerData layerData)
Extract a PLANit node from the osmNode information and register it on the provided layerstatic Node
createPopulateAndRegisterNode(org.locationtech.jts.geom.Point osmNodeLocation, MacroscopicNetworkLayer networkLayer, OsmNetworkReaderLayerData layerData)
Extract a PLANit node from the location information and register it on the provided layerstatic String
getLinkOsmWayType(Link link)
Collect the osm way type of the linkstatic void
setLinkOsmWayType(Link link, String osmWayType)
set the osm way type
-
-
-
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
-
-
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
-
breakLinksWithInternalNode
public static Map<Long,Set<Link>> breakLinksWithInternalNode(Node theNode, List<Link> linksToBreak, MacroscopicNetworkLayer networkLayer, org.opengis.referencing.crs.CoordinateReferenceSystem crs) throws PlanItException
Check if we should break any links for the passed in node and if so, do it- Parameters:
theNode
- to verifylinksToBreak
- contains the links that (at least at some point) had theNode as an internal linknetworkLayer
- the node resides oncrs
- of the network layer- Returns:
- newly broken PLANit links by their original osmWayId
- Throws:
PlanItException
- thrown if error
-
createAndPopulateNode
public static Node createAndPopulateNode(de.topobyte.osm4j.core.model.iface.OsmNode osmNode, MacroscopicNetworkLayer networkLayer)
Extract a PLANit node from the osmNode information- Parameters:
osmNode
- to create PLANit node fornetworkLayer
- to create node on- Returns:
- created node, null when something went wrong
-
createAndPopulateNode
public static Node createAndPopulateNode(org.locationtech.jts.geom.Point geometry, MacroscopicNetworkLayer networkLayer)
Extract a PLANit node from the osmNode information- Parameters:
geometry
- to place on PLANit nodenetworkLayer
- to create node on- Returns:
- created node, null when something went wrong
-
createPopulateAndRegisterNode
public static Node createPopulateAndRegisterNode(de.topobyte.osm4j.core.model.iface.OsmNode osmNode, MacroscopicNetworkLayer networkLayer, OsmNetworkReaderLayerData layerData) throws PlanItException
Extract a PLANit node from the osmNode information and register it on the provided layer- Parameters:
osmNode
- to create PLANit node fornetworkLayer
- to create node onlayerData
- to register on- Returns:
- created node, null when something went wrong
- Throws:
PlanItException
- thrown if error
-
createPopulateAndRegisterNode
public static Node createPopulateAndRegisterNode(org.locationtech.jts.geom.Point osmNodeLocation, MacroscopicNetworkLayer networkLayer, OsmNetworkReaderLayerData layerData) throws PlanItException
Extract a PLANit node from the location information and register it on the provided layer- Parameters:
osmNodeLocation
- to create PLANit node fornetworkLayer
- to create node onlayerData
- to register on- Returns:
- created node, null when something went wrong
- Throws:
PlanItException
- thrown if error
-
-