Fixes issue #101. Target nodes close to bollards were neglected.
This commit is contained in:
parent
9da873330a
commit
5136853ce0
@ -129,8 +129,7 @@ void EdgeBasedGraphFactory::Run() {
|
|||||||
for(_NodeBasedDynamicGraph::EdgeIterator e1 = _nodeBasedGraph->BeginEdges(u); e1 < _nodeBasedGraph->EndEdges(u); ++e1) {
|
for(_NodeBasedDynamicGraph::EdgeIterator e1 = _nodeBasedGraph->BeginEdges(u); e1 < _nodeBasedGraph->EndEdges(u); ++e1) {
|
||||||
++nodeBasedEdgeCounter;
|
++nodeBasedEdgeCounter;
|
||||||
_NodeBasedDynamicGraph::NodeIterator v = _nodeBasedGraph->GetTarget(e1);
|
_NodeBasedDynamicGraph::NodeIterator v = _nodeBasedGraph->GetTarget(e1);
|
||||||
if(_bollardNodes.Find(v) == true)
|
|
||||||
continue;
|
|
||||||
//loop over all reachable edges (v,w)
|
//loop over all reachable edges (v,w)
|
||||||
bool isOnlyAllowed(false);
|
bool isOnlyAllowed(false);
|
||||||
|
|
||||||
@ -174,8 +173,15 @@ void EdgeBasedGraphFactory::Run() {
|
|||||||
edgeBasedNodes.push_back(currentNode);
|
edgeBasedNodes.push_back(currentNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(_bollardNodes.Find(v) == true) {
|
||||||
|
numberOfSkippedTurns += _nodeBasedGraph->EndEdges(v) - _nodeBasedGraph->BeginEdges(v);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
for(_NodeBasedDynamicGraph::EdgeIterator e2 = _nodeBasedGraph->BeginEdges(v); e2 < _nodeBasedGraph->EndEdges(v); ++e2) {
|
for(_NodeBasedDynamicGraph::EdgeIterator e2 = _nodeBasedGraph->BeginEdges(v); e2 < _nodeBasedGraph->EndEdges(v); ++e2) {
|
||||||
_NodeBasedDynamicGraph::NodeIterator w = _nodeBasedGraph->GetTarget(e2);
|
_NodeBasedDynamicGraph::NodeIterator w = _nodeBasedGraph->GetTarget(e2);
|
||||||
|
|
||||||
|
|
||||||
//if (u,v,w) is a forbidden turn, continue
|
//if (u,v,w) is a forbidden turn, continue
|
||||||
if(isOnlyAllowed && w != onlyToNode) {
|
if(isOnlyAllowed && w != onlyToNode) {
|
||||||
//We are at an only_-restriction but not at the right turn.
|
//We are at an only_-restriction but not at the right turn.
|
||||||
@ -224,6 +230,21 @@ void EdgeBasedGraphFactory::Run() {
|
|||||||
EdgeBasedEdge newEdge(edgeBasedSource, edgeBasedTarget, v, nameID, distance, true, false, turnInstruction);
|
EdgeBasedEdge newEdge(edgeBasedSource, edgeBasedTarget, v, nameID, distance, true, false, turnInstruction);
|
||||||
edgeBasedEdges.push_back(newEdge);
|
edgeBasedEdges.push_back(newEdge);
|
||||||
|
|
||||||
|
if(_bollardNodes.Find(w) == true){
|
||||||
|
// INFO("[" << w << "] loc: " << inputNodeInfoList[w].lat << "," << inputNodeInfoList[w].lon << ", tgt: " << edgeBasedTarget);
|
||||||
|
//if node v is a bollard, then we need to add e2 as target node to the new set of edgebased nodes.
|
||||||
|
//Otherwise it will not be possible to route to route to this node
|
||||||
|
EdgeBasedNode currentNode;
|
||||||
|
currentNode.nameID = _nodeBasedGraph->GetEdgeData(e1).nameID;
|
||||||
|
currentNode.lat1 = inputNodeInfoList[v].lat;
|
||||||
|
currentNode.lon1 = inputNodeInfoList[v].lon;
|
||||||
|
currentNode.lat2 = inputNodeInfoList[w].lat;
|
||||||
|
currentNode.lon2 = inputNodeInfoList[w].lon;
|
||||||
|
currentNode.id = edgeBasedTarget;
|
||||||
|
currentNode.ignoreInGrid = _nodeBasedGraph->GetEdgeData(e2).ignoreInGrid;
|
||||||
|
edgeBasedNodes.push_back(currentNode);
|
||||||
|
|
||||||
|
}
|
||||||
if(_nodeBasedGraph->GetEdgeData(e1).type != SHRT_MAX ) {
|
if(_nodeBasedGraph->GetEdgeData(e1).type != SHRT_MAX ) {
|
||||||
EdgeBasedNode currentNode;
|
EdgeBasedNode currentNode;
|
||||||
currentNode.nameID = _nodeBasedGraph->GetEdgeData(e1).nameID;
|
currentNode.nameID = _nodeBasedGraph->GetEdgeData(e1).nameID;
|
||||||
|
Loading…
Reference in New Issue
Block a user