Package com.graphhopper.routing
Class Path
java.lang.Object
com.graphhopper.routing.Path
This class represents the result of a shortest path calculation. It also provides methods to extract further
information about the found path, like instructions etc.
- Author:
- Peter Karich, Ottavio Campana, jan soe, easbar
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
The callback used in forEveryEdge. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddDistance
(double distance) void
addEdge
(int edge) addTime
(long time) Returns the list of all edges.com.carrotsearch.hppc.IntIndexedContainer
This method calculated a list of points for this pathvoid
forEveryEdge
(Path.EdgeVisitor visitor) Iterates over all edges in this path sorted from start to end and calls the visitor callback for every edge.double
int
com.carrotsearch.hppc.IntArrayList
getEdges()
int
Yields the final edge of the pathgetGraph()
long
getTime()
double
This weight will be updated during the algorithm.boolean
isFound()
void
setDebugInfo
(String debugInfo) setDescription
(List<String> description) setDistance
(double distance) void
setEdges
(com.carrotsearch.hppc.IntArrayList edgeIds) setEndNode
(int end) setFound
(boolean found) setFromNode
(int from) We need to remember fromNode explicitly as its not saved in one edgeId of edgeIds.setTime
(long time) setWeight
(double w) toString()
-
Constructor Details
-
Path
-
-
Method Details
-
getGraph
-
getDescription
- Returns:
- the description of this route alternative to make it meaningful for the user e.g. it displays one or two main roads of the route.
-
setDescription
-
getEdges
public com.carrotsearch.hppc.IntArrayList getEdges() -
setEdges
public void setEdges(com.carrotsearch.hppc.IntArrayList edgeIds) -
addEdge
public void addEdge(int edge) -
getEdgeCount
public int getEdgeCount() -
getEndNode
public int getEndNode() -
setEndNode
-
setFromNode
We need to remember fromNode explicitly as its not saved in one edgeId of edgeIds. -
isFound
public boolean isFound() -
setFound
-
setDistance
-
addDistance
-
getDistance
public double getDistance()- Returns:
- distance in meter
-
getTime
public long getTime()- Returns:
- time in millis
-
setTime
-
addTime
-
getWeight
public double getWeight()This weight will be updated during the algorithm. The initial value is maximum double. -
setWeight
-
getFinalEdge
Yields the final edge of the path -
setDebugInfo
-
getDebugInfo
-
forEveryEdge
Iterates over all edges in this path sorted from start to end and calls the visitor callback for every edge.- Parameters:
visitor
- callback to handle every edge. The edge is decoupled from the iterator and can be stored.
-
calcEdges
Returns the list of all edges. -
calcNodes
public com.carrotsearch.hppc.IntIndexedContainer calcNodes()- Returns:
- the uncached node indices of the tower nodes in this path.
-
calcPoints
This method calculated a list of points for this path- Returns:
- the geometry of this path
-
toString
-