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(CHProfile chProfile)
|
GraphHopperStorage |
addCHGraphs(List<CHProfile> chProfiles) |
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() |
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.
|
EdgeIteratorState |
edge(int a,
int b,
double distance,
boolean bothDirections)
Use edge(a,b).setDistance().setFlags instead
|
void |
flush()
This method makes sure that the underlying data is written to the storage.
|
void |
flushAndCloseEarly()
Flush and close resources like wayGeometry that are not needed for CH preparation.
|
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() |
CHGraph |
getCHGraph() |
CHGraph |
getCHGraph(CHProfile chProfile) |
CHGraph |
getCHGraph(String profileName) |
List<CHProfile> |
getCHProfiles() |
List<CHProfile> |
getCHProfiles(boolean edgeBased) |
Directory |
getDirectory() |
EdgeIteratorState |
getEdgeIteratorState(int edgeId,
int adjNode)
Returns a wrapper over the specified edgeId.
|
int |
getEdges() |
EncodingManager |
getEncodingManager() |
NodeAccess |
getNodeAccess()
Creates a node explorer to access node properties.
|
int |
getNodes() |
int |
getOtherNode(int edge,
int node) |
StorableProperties |
getProperties() |
TurnCostStorage |
getTurnCostStorage() |
boolean |
isAdjacentToNode(int edge,
int node) |
boolean |
isCHPossible() |
boolean |
isClosed() |
boolean |
isNodeRemoved(int index)
Checks if the specified node is marked as removed.
|
boolean |
loadExisting() |
void |
markNodeRemoved(int index)
Schedule the deletion of the specified node until an optimize() call happens
|
void |
optimize()
Performs optimization routines like deletion or node rearrangements.
|
String |
toDetailsString() |
String |
toString() |
Weighting |
wrapWeighting(Weighting weighting)
Wraps the given weighting into a weighting that can be used by this graph
|
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(CHProfile chProfile)
CHGraph for the given CHProfile. You need to call this method before calling create(long)
or loadExisting().public GraphHopperStorage addCHGraphs(List<CHProfile> chProfiles)
addCHGraph(CHProfile)public CHGraph getCHGraph()
public CHGraph getCHGraph(String profileName)
CHGraph for the specified profile namepublic boolean isCHPossible()
public Directory getDirectory()
getDirectory in interface GraphStoragepublic GraphHopperStorage create(long byteCount)
create in interface Storable<GraphStorage>public EncodingManager getEncodingManager()
getEncodingManager in interface GraphStoragepublic StorableProperties getProperties()
getProperties in interface GraphStoragepublic void markNodeRemoved(int index)
GraphStoragemarkNodeRemoved in interface GraphStoragepublic boolean isNodeRemoved(int index)
GraphStorageisNodeRemoved in interface GraphStoragepublic void optimize()
GraphStorageoptimize in interface GraphStoragepublic boolean loadExisting()
loadExisting in interface Storable<GraphStorage>public void flush()
Storableflush in interface Storable<GraphStorage>public void close()
Storableclose in interface Storable<GraphStorage>close in interface Closeableclose in interface AutoCloseablepublic boolean isClosed()
isClosed in interface Storable<GraphStorage>public long getCapacity()
getCapacity in interface Storable<GraphStorage>public void freeze()
public String toDetailsString()
toDetailsString in interface GraphStoragepublic Graph getBaseGraph()
getBaseGraph in interface Graphpublic int getNodes()
public int getEdges()
public NodeAccess getNodeAccess()
GraphgetNodeAccess in interface Graphpublic BBox getBounds()
Graphpublic EdgeIteratorState edge(int a, int b)
Graphpublic EdgeIteratorState edge(int a, int b, double distance, boolean bothDirections)
Graphpublic EdgeIteratorState getEdgeIteratorState(int edgeId, 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 AllEdgesIterator getAllEdges()
getAllEdges in interface Graphpublic EdgeExplorer createEdgeExplorer(EdgeFilter filter)
GraphcreateEdgeExplorer in interface GraphEdgeExplorer,
Graph.createEdgeExplorer()public EdgeExplorer createEdgeExplorer()
createEdgeExplorer in interface GraphGraph.createEdgeExplorer(com.graphhopper.routing.util.EdgeFilter)public Graph copyTo(Graph g)
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 Graphpublic void flushAndCloseEarly()
Copyright © 2012–2020. All rights reserved.