Class EdgeElevationInterpolator

java.lang.Object
com.graphhopper.reader.dem.EdgeElevationInterpolator

public class EdgeElevationInterpolator extends Object
Abstract base class for tunnel/bridge edge elevation interpolators. This class estimates elevation of inner nodes of a tunnel/bridge based on elevations of entry nodes. See #713 for more information.

Since inner nodes of tunnel or bridge do not lie on the Earth surface, we should not use elevations returned by the elevation provider for these points. Instead, we'll estimate elevations of these points based on elevations of entry/exit nodes of the tunnel/bridge.

To do this, we'll iterate over the graph looking for tunnel or bridge edges using isInterpolatableEdge(EdgeIteratorState). Once such an edge is found, we'll calculate a connected component of tunnel/bridge edges starting from the base node of this edge, using simple BreadthFirstSearch. Nodes which only have interpolatabe edges connected to them are inner nodes and are considered to not lie on the Earth surface. Nodes which also have non-interpolatable edges are outer nodes and are considered to lie on the Earth surface. Elevations of inner nodes are then interpolated from the outer nodes using NodeElevationInterpolator. Elevations of pillar nodes are calculated using linear interpolation on distances from tower nodes.

Author:
Alexey Valikov