fix rounding of travel times
This commit is contained in:
parent
b0b67a0cdc
commit
2ec952032a
@ -71,7 +71,7 @@ public:
|
|||||||
) {
|
) {
|
||||||
//compute distance/duration for route summary
|
//compute distance/duration for route summary
|
||||||
intToString(round(distance), lengthString);
|
intToString(round(distance), lengthString);
|
||||||
int travel_time = time/10;
|
int travel_time = round(time/10.);
|
||||||
intToString(std::max(travel_time, 1), durationString);
|
intToString(std::max(travel_time, 1), durationString);
|
||||||
}
|
}
|
||||||
} summary;
|
} summary;
|
||||||
|
@ -129,6 +129,8 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SimpleLogger().Write(logDEBUG) << "distance: " << raw_route.lengthOfShortestPath;
|
||||||
|
|
||||||
//check if first segment is non-zero
|
//check if first segment is non-zero
|
||||||
std::string road_name;
|
std::string road_name;
|
||||||
road_name = facade->GetEscapedNameForNameID(phantom_nodes.source_phantom.name_id);
|
road_name = facade->GetEscapedNameForNameID(phantom_nodes.source_phantom.name_id);
|
||||||
@ -488,7 +490,7 @@ public:
|
|||||||
intToString(necessary_segments_running_index, temp_length);
|
intToString(necessary_segments_running_index, temp_length);
|
||||||
reply.content.push_back(temp_length);
|
reply.content.push_back(temp_length);
|
||||||
reply.content.push_back(",");
|
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(temp_duration);
|
||||||
reply.content.push_back(",\"");
|
reply.content.push_back(",\"");
|
||||||
intToString(segment.length, temp_length);
|
intToString(segment.length, temp_length);
|
||||||
|
Loading…
Reference in New Issue
Block a user