This commit is contained in:
Emil Tin 2011-12-02 15:27:26 +01:00
commit 653fe572cb
2 changed files with 9 additions and 7 deletions

View File

@ -173,8 +173,14 @@ public:
w.nameID = strit->second;
}
GUARANTEE(w.id != UINT_MAX, "found way with unknown type");
GUARANTEE(-1 != w.speed, "found way with unknown speed");
if(-1 == w.speed){
WARN("found way with bogus speed, id: " << w.id);
return true;
}
if(w.id == UINT_MAX) {
WARN("found way with unknown type" << w.id);
return true;
}
if ( w.direction == _Way::opposite ){
std::reverse( w.path.begin(), w.path.end() );

View File

@ -310,10 +310,6 @@ public:
double tmpDist = ComputeDistance(startCoord, candidate.startCoord, candidate.targetCoord, tmp, &r);
if(DoubleEpsilonCompare(dist, tmpDist) && 1 == std::abs((int)candidate.edgeBasedNode-(int)resultNode.edgeBasedNode)) {
resultNode.weight2 = candidate.weight;
/* if(resultNode.weight1 != resultNode.weight2) {
ERR("w1: " << resultNode.weight1 << ", w2: " << resultNode.weight2);
assert(false);
}*/
if(candidate.edgeBasedNode < resultNode.edgeBasedNode) {
resultNode.edgeBasedNode = candidate.edgeBasedNode;
std::swap(resultNode.weight1, resultNode.weight2);
@ -412,7 +408,7 @@ private:
}
inline bool DoubleEpsilonCompare(const double d1, const double d2) {
return (std::fabs(d1 - d2) < 0.000000001);
return (std::fabs(d1 - d2) < 0.0001);
}
unsigned FillCell(std::vector<GridEntry>& entriesWithSameRAMIndex, unsigned fileOffset ) {