last leg of route is now computed correctly
This commit is contained in:
parent
6cefcf568b
commit
41e5a52509
@ -30,7 +30,8 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
|
|
||||||
struct _HeapData {
|
struct _HeapData {
|
||||||
NodeID parent;
|
NodeID parent;
|
||||||
_HeapData( NodeID p ) : parent(p) { }
|
bool stalled;
|
||||||
|
_HeapData( NodeID p ) : parent(p) , stalled(false) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef BinaryHeap< NodeID, int, int, _HeapData, DenseStorage< NodeID, unsigned > > _Heap;
|
typedef BinaryHeap< NodeID, int, int, _HeapData, DenseStorage< NodeID, unsigned > > _Heap;
|
||||||
@ -151,10 +152,10 @@ public:
|
|||||||
packedPath.push_back( middle );
|
packedPath.push_back( middle );
|
||||||
pathNode = middle;
|
pathNode = middle;
|
||||||
|
|
||||||
while ( pathNode != phantomNodes->targetNode2 && pathNode != phantomNodes->targetNode1 ) {
|
do {
|
||||||
pathNode = _backwardHeap->GetData( pathNode ).parent;
|
pathNode = _backwardHeap->GetData( pathNode ).parent;
|
||||||
packedPath.push_back( pathNode );
|
packedPath.push_back( pathNode );
|
||||||
}
|
} while ( pathNode != phantomNodes->targetNode2 && pathNode != phantomNodes->targetNode1 ) ;
|
||||||
|
|
||||||
// push start node explicitely
|
// push start node explicitely
|
||||||
path->push_back(packedPath[0]);
|
path->push_back(packedPath[0]);
|
||||||
|
@ -168,10 +168,10 @@ public:
|
|||||||
rep.content += tmp;
|
rep.content += tmp;
|
||||||
rep.content += (" ");
|
rep.content += (" ");
|
||||||
}
|
}
|
||||||
convertLatLon(targetCoord.lon, tmp);
|
convertLatLon(phantomNodes->targetCoord.lon, tmp);
|
||||||
rep.content += tmp;
|
rep.content += tmp;
|
||||||
rep.content += (",");
|
rep.content += (",");
|
||||||
convertLatLon(targetCoord.lat, tmp);
|
convertLatLon(phantomNodes->targetCoord.lat, tmp);
|
||||||
rep.content += tmp;
|
rep.content += tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user