Implements issue #324. Thanks tyrasd.

This commit is contained in:
DennisOSRM 2012-08-13 17:31:46 +02:00
parent ebc3d09f0f
commit 411803919d

View File

@ -416,7 +416,7 @@ int main (int argc, char *argv[]) {
double distance = ApproximateDistance(edgeIT->startCoord.lat, edgeIT->startCoord.lon, nodesIT->lat, nodesIT->lon);
assert(edgeIT->speed != -1);
double weight = ( distance * 10. ) / (edgeIT->speed / 3.6);
int intWeight = std::max(1, (int)(edgeIT->isDurationSet ? edgeIT->speed : weight) );
int intWeight = std::max(1, (int)std::floor((edgeIT->isDurationSet ? edgeIT->speed : weight)+.5) );
int intDist = std::max(1, (int)distance);
short zero = 0;
short one = 1;