MCPcopy Index your code
hub / github.com/graphhopper/graphhopper / Graph

Interface Graph

core/src/main/java/com/graphhopper/storage/Graph.java:33–126  ·  view source on GitHub ↗

An interface to represent a (geo) graph - suited for efficient storage as it can be requested via indices called node IDs. To get the lat,lon point you need to set up a LocationIndex instance. @author Peter Karich

Source from the content-addressed store, hash-verified

31 * @author Peter Karich
32 */
33public interface Graph {
34 /**
35 * @return a graph which behaves like an unprepared graph and e.g. the normal unidirectional
36 * Dijkstra or any graph traversal algorithm can be executed.
37 */
38 BaseGraph getBaseGraph();
39
40 /**
41 * @return the number of created locations - via setNode() or edge()
42 */
43 int getNodes();
44
45 /**
46 * @return the number of edges in this graph. Equivalent to getAllEdges().length().
47 */
48 int getEdges();
49
50 /**
51 * Creates an object to access node properties.
52 */
53 NodeAccess getNodeAccess();
54
55 /**
56 * Returns the implicit bounds of this graph calculated from the lat,lon input of setNode
57 */
58 BBox getBounds();
59
60 /**
61 * Creates an edge between the nodes a and b. To set distance or access use the returned edge
62 * and e.g. edgeState.setDistance
63 *
64 * @param a the index of the starting (tower) node of the edge
65 * @param b the index of the ending (tower) node of the edge
66 * @return the newly created edge
67 */
68 EdgeIteratorState edge(int a, int b);
69
70 /**
71 * Returns a wrapper over the specified edgeId.
72 *
73 * @param adjNode is the node that will be returned via getAdjNode(). If adjNode is
74 * Integer.MIN_VALUE then the edge will be returned in the direction of how it is stored
75 * @return a new EdgeIteratorState object or potentially null if adjNode does not match
76 * @throws IllegalStateException if edgeId is not valid
77 */
78 EdgeIteratorState getEdgeIteratorState(int edgeId, int adjNode);
79
80 /**
81 * Returns the edge state for the given edge key
82 *
83 * @see EdgeIteratorState#getEdgeKey()
84 */
85 EdgeIteratorState getEdgeIteratorStateForKey(int edgeKey);
86
87 /**
88 * @return the 'opposite' node of a given edge, so if there is an edge 3-2 and node =2 this returns 3
89 */
90 int getOtherNode(int edge, int node);

Callers 102

measureRoutingMethod · 0.65
runCompareTestMethod · 0.65
runPerformanceTestMethod · 0.65
MiniGraphUIMethod · 0.65
createBitSetMethod · 0.65
testFootAndCarMethod · 0.65
measureRoutingMethod · 0.95
runCompareTestMethod · 0.95
runPerformanceTestMethod · 0.95

Implementers 3

BaseGraphcore/src/main/java/com/graphhopper/sto
QueryGraphcore/src/main/java/com/graphhopper/rou
PtGraphAsAdjacencyListreader-gtfs/src/main/java/com/graphhop

Calls

no outgoing calls

Tested by

no test coverage detected