fix rounding of travel times

This commit is contained in:
Dennis Luxen 2014-04-25 13:22:58 +02:00
parent b0b67a0cdc
commit 2ec952032a
2 changed files with 4 additions and 2 deletions

View File

@ -71,7 +71,7 @@ public:
) {
//compute distance/duration for route summary
intToString(round(distance), lengthString);
int travel_time = time/10;
int travel_time = round(time/10.);
intToString(std::max(travel_time, 1), durationString);
}
} summary;

View File

@ -129,6 +129,8 @@ public:
return;
}
SimpleLogger().Write(logDEBUG) << "distance: " << raw_route.lengthOfShortestPath;
//check if first segment is non-zero
std::string road_name;
road_name = facade->GetEscapedNameForNameID(phantom_nodes.source_phantom.name_id);
@ -488,7 +490,7 @@ public:
intToString(necessary_segments_running_index, temp_length);
reply.content.push_back(temp_length);
reply.content.push_back(",");
intToString(segment.duration/10, temp_duration);
intToString(round(segment.duration/10.), temp_duration);
reply.content.push_back(temp_duration);
reply.content.push_back(",\"");
intToString(segment.length, temp_length);