re-enable hintin mechanism

This commit is contained in:
Dennis Luxen
2015-01-05 12:59:29 +01:00
parent b384340cbb
commit a4919ffb45
4 changed files with 40 additions and 15 deletions
+13 -13
View File
@@ -279,19 +279,19 @@ template <class DataFacadeT> class JSONDescriptor final : public BaseDescriptor<
json_result.values["alternative_names"] = json_alternate_names_array;
}
// JSON::Object json_hint_object;
// json_hint_object.values["checksum"] = facade->GetCheckSum();
// JSON::Array json_location_hint_array;
// std::string hint;
// for (const auto i : osrm::irange<std::size_t>(0, raw_route.segment_end_coordinates.size()))
// {
// ObjectEncoder::EncodeToBase64(raw_route.segment_end_coordinates[i].source_phantom, hint);
// json_location_hint_array.values.push_back(hint);
// }
// ObjectEncoder::EncodeToBase64(raw_route.segment_end_coordinates.back().target_phantom, hint);
// json_location_hint_array.values.push_back(hint);
// json_hint_object.values["locations"] = json_location_hint_array;
// json_result.values["hint_data"] = json_hint_object;
JSON::Object json_hint_object;
json_hint_object.values["checksum"] = facade->GetCheckSum();
JSON::Array json_location_hint_array;
std::string hint;
for (const auto i : osrm::irange<std::size_t>(0, raw_route.segment_end_coordinates.size()))
{
ObjectEncoder::EncodeToBase64(raw_route.segment_end_coordinates[i].source_phantom, hint);
json_location_hint_array.values.push_back(hint);
}
ObjectEncoder::EncodeToBase64(raw_route.segment_end_coordinates.back().target_phantom, hint);
json_location_hint_array.values.push_back(hint);
json_hint_object.values["locations"] = json_location_hint_array;
json_result.values["hint_data"] = json_hint_object;
// render the content to the output array
TIMER_START(route_render);