public class QueryGraph extends Object implements Graph
| Constructor and Description |
|---|
QueryGraph(Graph graph) |
| 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.
|
EdgeExplorer |
createEdgeExplorer() |
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
|
EdgeIteratorState |
edge(int a,
int b,
double distance,
int flags) |
boolean |
enforceHeading(int nodeId,
double favoredHeading,
boolean incoming)
Set those edges at the virtual node (nodeId) to 'unfavored' that require at least a turn of
100° from favoredHeading
|
boolean |
enforceHeadingByEdgeId(int nodeId,
int edgeId,
boolean incoming)
Set one specific edge at the virtual node with nodeId to 'unfavored' to enforce routing along
other edges
|
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.
|
GraphExtension |
getExtension() |
NodeAccess |
getNodeAccess()
Creates a node explorer to access node properties.
|
int |
getNodes() |
boolean |
isVirtualEdge(int edgeId) |
boolean |
isVirtualNode(int nodeId) |
void |
lookup(List<QueryResult> resList)
For all specified query results calculate snapped point and set closest node and edge to a
virtual one if necessary.
|
QueryGraph |
lookup(QueryResult fromRes,
QueryResult toRes)
Convenient method to initialize this QueryGraph with the two specified query results.
|
QueryGraph |
setUseEdgeExplorerCache(boolean useEECache)
This method is an experimental feature to reduce memory and CPU resources if there are many
locations ("hundreds") for one QueryGraph.
|
public QueryGraph(Graph graph)
public QueryGraph lookup(QueryResult fromRes, QueryResult toRes)
public void lookup(List<QueryResult> resList)
public Graph getBaseGraph()
getBaseGraph in interface Graphpublic boolean isVirtualEdge(int edgeId)
public boolean isVirtualNode(int nodeId)
public QueryGraph setUseEdgeExplorerCache(boolean useEECache)
public boolean enforceHeading(int nodeId,
double favoredHeading,
boolean incoming)
nodeId - VirtualNode at which edges get unfavoredfavoredHeading - north based azimuth of favored heading between 0 and 360incoming - if true, incoming edges are unfavored, else outgoing edgespublic boolean enforceHeadingByEdgeId(int nodeId,
int edgeId,
boolean incoming)
nodeId - VirtualNode at which edges get unfavorededgeId - edge to become unfavoredincoming - if true, incoming edge is unfavored, else outgoing edgepublic void clearUnfavoredStatus()
public int getNodes()
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 adjNode(). If adjNode is
Integer.MIN_VALUE then the edge with uncertain values for adjNode and baseNode (two
possibilities) will be returned.public EdgeExplorer createEdgeExplorer(EdgeFilter edgeFilter)
GraphcreateEdgeExplorer in interface GraphEdgeExplorer,
Graph.createEdgeExplorer()public EdgeExplorer createEdgeExplorer()
createEdgeExplorer in interface GraphGraph.createEdgeExplorer(com.graphhopper.routing.util.EdgeFilter)public AllEdgesIterator getAllEdges()
getAllEdges in interface Graphpublic EdgeIteratorState edge(int a, int b)
Graphpublic EdgeIteratorState edge(int a, int b, double distance, int flags)
public EdgeIteratorState edge(int a, int b, double distance, boolean bothDirections)
Graphpublic Graph copyTo(Graph g)
Graphpublic GraphExtension getExtension()
getExtension in interface GraphCopyright © 2012–2016. All rights reserved.