public final class GraphHopperStorage extends Object implements GraphStorage, Graph
to create a (CH)Graph easier
,
getGraph(java.lang.Class)
Constructor and Description |
---|
GraphHopperStorage(Directory dir,
EncodingManager encodingManager,
boolean withElevation,
GraphExtension extendedStorage) |
GraphHopperStorage(List<? extends Weighting> chWeightings,
Directory dir,
EncodingManager encodingManager,
boolean withElevation,
GraphExtension extendedStorage) |
Modifier and Type | Method and Description |
---|---|
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 |
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<Weighting> |
getCHWeightings() |
Directory |
getDirectory() |
EdgeIteratorState |
getEdgeIteratorState(int edgeId,
int adjNode)
Returns a wrapper over the specified edgeId.
|
EncodingManager |
getEncodingManager() |
GraphExtension |
getExtension() |
<T extends Graph> |
getGraph(Class<T> clazz) |
<T extends Graph> |
getGraph(Class<T> clazz,
Weighting weighting)
This method returns the routing graph for the specified weighting, could be potentially
filled with shortcuts.
|
NodeAccess |
getNodeAccess()
Creates a node explorer to access node properties.
|
int |
getNodes() |
StorableProperties |
getProperties() |
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.
|
void |
setAdditionalEdgeField(long edgePointer,
int value) |
void |
setSegmentSize(int bytes) |
String |
toDetailsString() |
String |
toString() |
public GraphHopperStorage(Directory dir, EncodingManager encodingManager, boolean withElevation, GraphExtension extendedStorage)
public GraphHopperStorage(List<? extends Weighting> chWeightings, Directory dir, EncodingManager encodingManager, boolean withElevation, GraphExtension extendedStorage)
public <T extends Graph> T getGraph(Class<T> clazz, Weighting weighting)
public boolean isCHPossible()
public Directory getDirectory()
getDirectory
in interface GraphStorage
public void setSegmentSize(int bytes)
setSegmentSize
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 void setAdditionalEdgeField(long edgePointer, int value)
public void markNodeRemoved(int index)
GraphStorage
markNodeRemoved
in interface GraphStorage
public boolean isNodeRemoved(int index)
GraphStorage
isNodeRemoved
in interface GraphStorage
public void optimize()
GraphStorage
optimize
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 NodeAccess getNodeAccess()
Graph
getNodeAccess
in interface Graph
public BBox getBounds()
Graph
public EdgeIteratorState edge(int a, int b)
Graph
public EdgeIteratorState edge(int a, int b, double distance, boolean bothDirections)
Graph
public EdgeIteratorState getEdgeIteratorState(int edgeId, int adjNode)
Graph
getEdgeIteratorState
in interface Graph
adjNode
- 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 AllEdgesIterator getAllEdges()
getAllEdges
in interface Graph
public EdgeExplorer createEdgeExplorer(EdgeFilter filter)
Graph
createEdgeExplorer
in interface Graph
EdgeExplorer
,
Graph.createEdgeExplorer()
public EdgeExplorer createEdgeExplorer()
createEdgeExplorer
in interface Graph
Graph.createEdgeExplorer(com.graphhopper.routing.util.EdgeFilter)
public Graph copyTo(Graph g)
Graph
public GraphExtension getExtension()
getExtension
in interface Graph
Copyright © 2012–2016. All rights reserved.