public class EdgeElevationInterpolator extends Object
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.
Modifier and Type | Field and Description |
---|---|
protected EnumEncodedValue<RoadEnvironment> |
roadEnvironmentEnc |
Constructor and Description |
---|
EdgeElevationInterpolator(GraphHopperStorage storage,
EnumEncodedValue<RoadEnvironment> roadEnvironmentEnc,
RoadEnvironment interpolateKey) |
Modifier and Type | Method and Description |
---|---|
void |
execute() |
void |
gatherOuterAndInnerNodeIds(EdgeExplorer edgeExplorer,
EdgeIteratorState interpolatableEdge,
GHBitSet visitedEdgesIds,
com.carrotsearch.hppc.IntSet outerNodeIds,
GHIntHashSet innerNodeIds) |
GraphHopperStorage |
getStorage() |
protected boolean |
isInterpolatableEdge(EdgeIteratorState edge) |
protected final EnumEncodedValue<RoadEnvironment> roadEnvironmentEnc
public EdgeElevationInterpolator(GraphHopperStorage storage, EnumEncodedValue<RoadEnvironment> roadEnvironmentEnc, RoadEnvironment interpolateKey)
protected boolean isInterpolatableEdge(EdgeIteratorState edge)
public GraphHopperStorage getStorage()
public void execute()
public void gatherOuterAndInnerNodeIds(EdgeExplorer edgeExplorer, EdgeIteratorState interpolatableEdge, GHBitSet visitedEdgesIds, com.carrotsearch.hppc.IntSet outerNodeIds, GHIntHashSet innerNodeIds)
Copyright © 2012–2020. All rights reserved.