last leg of route is now computed correctly

This commit is contained in:
Dennis Luxen 2010-09-16 15:08:45 +00:00
parent 6cefcf568b
commit 41e5a52509
2 changed files with 6 additions and 5 deletions

View File

@ -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]);

View File

@ -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;
} }