public class QueryGraph extends Object implements Graph
Calling any create method creates virtual edges between the tower nodes of the existing
graph and new virtual tower nodes. Every virtual node has two adjacent nodes and is connected
to each adjacent nodes via 2 virtual edges with opposite base node / adjacent node encoding.
However, the edge explorer returned by Graph.createEdgeExplorer() only returns two
virtual edges per virtual node (the ones with correct base node).
| Modifier and Type | Method and Description |
|---|---|
void |
clearUnfavoredStatus()
Removes the 'unfavored' status of all virtual edges.
|
static QueryGraph |
create(BaseGraph graph,
List<Snap> snaps) |
static QueryGraph |
create(BaseGraph graph,
Snap snap) |
static QueryGraph |
create(BaseGraph graph,
Snap fromSnap,
Snap toSnap) |
EdgeExplorer |
createEdgeExplorer(EdgeFilter edgeFilter)
Returns an EdgeExplorer which makes it possible to traverse all filtered edges of a specific
node.
|
EdgeIteratorState |
edge(int a,
int b)
Creates an edge between the nodes a and b.
|
AllEdgesIterator |
getAllEdges() |
BaseGraph |
getBaseGraph() |
BBox |
getBounds()
Returns the implicit bounds of this graph calculated from the lat,lon input of setNode
|
EdgeIteratorState |
getEdgeIteratorState(int origEdgeId,
int adjNode)
Returns a wrapper over the specified edgeId.
|
EdgeIteratorState |
getEdgeIteratorStateForKey(int edgeKey)
Returns the edge state for the given edge key
|
int |
getEdges() |
NodeAccess |
getNodeAccess()
Creates an object to access node properties.
|
int |
getNodes() |
int |
getOtherNode(int edge,
int node) |
com.graphhopper.routing.querygraph.QueryOverlay |
getQueryOverlay() |
TurnCostStorage |
getTurnCostStorage() |
Set<EdgeIteratorState> |
getUnfavoredVirtualEdges()
Returns all virtual edges that have been unfavored via
unfavorVirtualEdge(int) or unfavorVirtualEdges(IntArrayList) |
boolean |
isAdjacentToNode(int edge,
int node) |
boolean |
isVirtualEdge(int edgeId) |
boolean |
isVirtualNode(int nodeId) |
void |
unfavorVirtualEdge(int virtualEdgeId)
Assigns the 'unfavored' flag to a virtual edge (for both directions)
|
void |
unfavorVirtualEdges(com.carrotsearch.hppc.IntArrayList edgeIds) |
Weighting |
wrapWeighting(Weighting weighting)
Wraps the given weighting into a weighting that can be used by this graph
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateEdgeExplorerpublic static QueryGraph create(BaseGraph graph, Snap snap)
public static QueryGraph create(BaseGraph graph, Snap fromSnap, Snap toSnap)
public static QueryGraph create(BaseGraph graph, List<Snap> snaps)
public com.graphhopper.routing.querygraph.QueryOverlay getQueryOverlay()
public BaseGraph getBaseGraph()
getBaseGraph in interface Graphpublic boolean isVirtualEdge(int edgeId)
public boolean isVirtualNode(int nodeId)
public void unfavorVirtualEdges(com.carrotsearch.hppc.IntArrayList edgeIds)
public void unfavorVirtualEdge(int virtualEdgeId)
public Set<EdgeIteratorState> getUnfavoredVirtualEdges()
unfavorVirtualEdge(int) or unfavorVirtualEdges(IntArrayList)public void clearUnfavoredStatus()
public int getNodes()
public int getEdges()
public NodeAccess getNodeAccess()
GraphgetNodeAccess in interface Graphpublic BBox getBounds()
Graphpublic EdgeIteratorState getEdgeIteratorState(int origEdgeId, int adjNode)
GraphgetEdgeIteratorState in interface GraphadjNode - is the node that will be returned via getAdjNode(). If adjNode is
Integer.MIN_VALUE then the edge will be returned in the direction of how it is storedpublic EdgeIteratorState getEdgeIteratorStateForKey(int edgeKey)
GraphgetEdgeIteratorStateForKey in interface GraphEdgeIteratorState.getEdgeKey()public EdgeExplorer createEdgeExplorer(EdgeFilter edgeFilter)
GraphcreateEdgeExplorer in interface Graphpublic AllEdgesIterator getAllEdges()
getAllEdges in interface Graphpublic EdgeIteratorState edge(int a, int b)
Graphpublic TurnCostStorage getTurnCostStorage()
getTurnCostStorage in interface GraphTurnCostStorage or null if not supportedpublic Weighting wrapWeighting(Weighting weighting)
GraphwrapWeighting in interface Graphpublic int getOtherNode(int edge,
int node)
getOtherNode in interface Graphpublic boolean isAdjacentToNode(int edge,
int node)
isAdjacentToNode in interface GraphCopyright © 2012–2022. All rights reserved.