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.
|
Graph |
copyTo(Graph g)
Copy this Graph into the specified Graph g.
|
static QueryGraph |
create(Graph graph,
List<Snap> snaps) |
static QueryGraph |
create(Graph graph,
Snap snap) |
static QueryGraph |
create(Graph 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.
|
EdgeIteratorState |
edge(int a,
int b,
double distance,
boolean bothDirections)
Use edge(a,b).setDistance().setFlags instead
|
AllEdgesIterator |
getAllEdges() |
Graph |
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.
|
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, wait
createEdgeExplorer
public static QueryGraph create(Graph graph, Snap snap)
public static QueryGraph create(Graph graph, Snap fromSnap, Snap toSnap)
public static QueryGraph create(Graph graph, List<Snap> snaps)
public com.graphhopper.routing.querygraph.QueryOverlay getQueryOverlay()
public Graph getBaseGraph()
getBaseGraph
in interface Graph
public 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()
Graph
getNodeAccess
in interface Graph
public BBox getBounds()
Graph
public EdgeIteratorState getEdgeIteratorState(int origEdgeId, int adjNode)
Graph
getEdgeIteratorState
in interface Graph
adjNode
- 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 EdgeExplorer createEdgeExplorer(EdgeFilter edgeFilter)
Graph
createEdgeExplorer
in interface Graph
public AllEdgesIterator getAllEdges()
getAllEdges
in interface Graph
public EdgeIteratorState edge(int a, int b)
Graph
public EdgeIteratorState edge(int a, int b, double distance, boolean bothDirections)
Graph
public Graph copyTo(Graph g)
Graph
public TurnCostStorage getTurnCostStorage()
getTurnCostStorage
in interface Graph
TurnCostStorage
or null if not supportedpublic Weighting wrapWeighting(Weighting weighting)
Graph
wrapWeighting
in interface Graph
public int getOtherNode(int edge, int node)
getOtherNode
in interface Graph
public boolean isAdjacentToNode(int edge, int node)
isAdjacentToNode
in interface Graph
Copyright © 2012–2021. All rights reserved.