Hi,
I need to get a set of points of a path obtained by Dijkstra’s algorithm, but I get the following error on the second iteration of the outer loop:
java.lang.RuntimeException: java.lang.IllegalStateException: Edge 2149 was empty when requested with node 59, array index:0, edges:221
This code:
for (int nodeFrom : nodeIdsFrom) {
for (int nodeTo : nodeIdsTo) {
Path path = dijkstra.calcPath(nodeFrom, nodeTo);
if (path.isFound()) {
PointList points = path.calcPoints();
// do something
}
}
}
Thank you for your help.
In that case, I would like to skip such points. Is it possible to check before the application crashes with this error?
Basically, this is the main code that can have at least some impact. What exactly would you like to see? Maybe initialization of the graph?
Here is an extension of the visitor class:
private class NodeVisitor extends LocationIndex.Visitor {
private final IntHashSet nodeIds = new IntHashSet();
IntHashSet getNodeIds() {
return nodeIds;
}
@Override
public void onNode(int nodeId) {
nodeIds.add(nodeId);
}
}
Sorry, but I don’t think I can help here, because I don’t know what you are doing. Why don’t you debug your code to see what is going on? It sounds like you are using a modified graphhopper version and this is error does not occur in master?