public final class GraphHopperStorage extends Object implements GraphStorage, Graph
to create a (CH)Graph easier
Constructor and Description |
---|
GraphHopperStorage(Directory dir,
EncodingManager encodingManager,
boolean withElevation) |
GraphHopperStorage(Directory dir,
EncodingManager encodingManager,
boolean withElevation,
boolean withTurnCosts) |
GraphHopperStorage(Directory dir,
EncodingManager encodingManager,
boolean withElevation,
boolean withTurnCosts,
int segmentSize) |
Modifier and Type | Method and Description |
---|---|
GraphHopperStorage |
addCHGraph(CHConfig chConfig)
|
GraphHopperStorage |
addCHGraphs(List<CHConfig> chConfigs) |
void |
close()
This method makes sure that the underlying used resources are released.
|
Graph |
copyTo(Graph g)
Copy this Graph into the specified Graph g.
|
GraphHopperStorage |
create(long byteCount)
After configuring this storage you need to create it explicitly.
|
EdgeExplorer |
createEdgeExplorer(EdgeFilter filter)
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.
|
void |
flush()
This method makes sure that the underlying data is written to the storage.
|
void |
flushAndCloseEarly()
Flush and free base graph resources like way geometries and StringIndex
|
void |
freeze()
Avoid that edges and nodes of the base graph are further modified.
|
AllEdgesIterator |
getAllEdges() |
Graph |
getBaseGraph() |
BBox |
getBounds()
Returns the implicit bounds of this graph calculated from the lat,lon input of setNode
|
long |
getCapacity() |
List<CHConfig> |
getCHConfigs() |
List<CHConfig> |
getCHConfigs(boolean edgeBased) |
CHGraph |
getCHGraph()
If possible use
getRoutingCHGraph(String) instead, as CHGraph will be removed at some point. |
CHGraph |
getCHGraph(String chGraphName) |
List<String> |
getCHGraphNames() |
Directory |
getDirectory() |
EdgeIteratorState |
getEdgeIteratorState(int edgeId,
int adjNode)
Returns a wrapper over the specified edgeId.
|
EdgeIteratorState |
getEdgeIteratorStateForKey(int edgeKey)
Returns the edge state for the given edge key
|
int |
getEdges() |
EncodingManager |
getEncodingManager() |
NodeAccess |
getNodeAccess()
Creates an object to access node properties.
|
int |
getNodes() |
int |
getOtherNode(int edge,
int node) |
StorableProperties |
getProperties() |
RoutingCHGraph |
getRoutingCHGraph() |
RoutingCHGraph |
getRoutingCHGraph(String chGraphName) |
TurnCostStorage |
getTurnCostStorage() |
boolean |
isAdjacentToNode(int edge,
int node) |
boolean |
isCHPossible() |
boolean |
isClosed() |
boolean |
loadExisting() |
String |
toDetailsString() |
String |
toString() |
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, wait, wait, wait
createEdgeExplorer
public GraphHopperStorage(Directory dir, EncodingManager encodingManager, boolean withElevation)
public GraphHopperStorage(Directory dir, EncodingManager encodingManager, boolean withElevation, boolean withTurnCosts)
public GraphHopperStorage(Directory dir, EncodingManager encodingManager, boolean withElevation, boolean withTurnCosts, int segmentSize)
public GraphHopperStorage addCHGraph(CHConfig chConfig)
CHGraph
for the given CHConfig
. You need to call this method before calling create(long)
or loadExisting()
.public GraphHopperStorage addCHGraphs(List<CHConfig> chConfigs)
addCHGraph(CHConfig)
public CHGraph getCHGraph()
getRoutingCHGraph(String)
instead, as CHGraph will be removed at some point.public CHGraph getCHGraph(String chGraphName)
CHGraph
for the specified profile name, or null if it does not existpublic RoutingCHGraph getRoutingCHGraph()
public RoutingCHGraph getRoutingCHGraph(String chGraphName)
public boolean isCHPossible()
public Directory getDirectory()
getDirectory
in interface GraphStorage
public GraphHopperStorage create(long byteCount)
create
in interface Storable<GraphStorage>
public EncodingManager getEncodingManager()
getEncodingManager
in interface GraphStorage
public StorableProperties getProperties()
getProperties
in interface GraphStorage
public boolean loadExisting()
loadExisting
in interface Storable<GraphStorage>
public void flush()
Storable
flush
in interface Storable<GraphStorage>
public void close()
Storable
close
in interface Storable<GraphStorage>
close
in interface Closeable
close
in interface AutoCloseable
public boolean isClosed()
isClosed
in interface Storable<GraphStorage>
public long getCapacity()
getCapacity
in interface Storable<GraphStorage>
public void freeze()
public String toDetailsString()
toDetailsString
in interface GraphStorage
public Graph getBaseGraph()
getBaseGraph
in interface Graph
public int getNodes()
public int getEdges()
public NodeAccess getNodeAccess()
Graph
getNodeAccess
in interface Graph
public BBox getBounds()
Graph
public EdgeIteratorState edge(int a, int b)
Graph
public EdgeIteratorState getEdgeIteratorState(int edgeId, 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 EdgeIteratorState getEdgeIteratorStateForKey(int edgeKey)
Graph
getEdgeIteratorStateForKey
in interface Graph
EdgeIteratorState.getEdgeKey()
public AllEdgesIterator getAllEdges()
getAllEdges
in interface Graph
public EdgeExplorer createEdgeExplorer(EdgeFilter filter)
Graph
createEdgeExplorer
in interface 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
public void flushAndCloseEarly()
Copyright © 2012–2021. All rights reserved.