GIScience / GIScience/openrouteservice

originalEdge not updated in CoreALT and CoreDijkstra iteration

Open
#975 0 comments 1 reaction 1 assignee Claimed by @aoles View on GitHub
easy-fix 😎 investigate
Dominant language
Java
Stars
2k
Forks
481
Avg merge
1d 14h
Merged PRs (30d)
52

Description

From `CoreDijkstra`, the iteration within `fillEdges`:
```SPTEntry ee = bestWeightMap.get(traversalId);
if (ee == null) {
ee = new SPTEntry(iter.getEdge(), iter.getAdjNode(), tmpWeight);
// Modification by Maxim Rylov: Assign the original edge id.
ee.originalEdge = EdgeIteratorStateHelper.getOriginalEdge(iter);
bestWeightMap.put(traversalId, ee);
} else if (ee.weight > tmpWeight) {
prioQueue.remove(ee);
ee.edge = iter.getEdge();
ee.weight = tmpWeight;
} else
continue;
```

The `orignalEdge` is set once for initialization, but not updated if a better path to the node is found. This might lead to problems with the weighting calculation later on:
```double calcWeight(EdgeIterator iter, SPTEntry currEdge, boolean reverse) {
return weighting.calcWeight(iter, reverse, currEdge.originalEdge);
}
```
Probably just updating the original edge will help. This might be hard to detect as a bug, as generally the update happens rarely. Might explain some turn restriction problems.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.