Added flatbuffers output support to the 'Nearest' service.
This commit is contained in:
@@ -25,7 +25,6 @@ Status NearestPlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms
|
||||
{
|
||||
BOOST_ASSERT(params.IsValid());
|
||||
|
||||
auto& json_result = result.get<util::json::Object>();
|
||||
if (!CheckAlgorithms(params, algorithms, result))
|
||||
return Status::Error;
|
||||
|
||||
@@ -57,7 +56,7 @@ Status NearestPlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms
|
||||
BOOST_ASSERT(phantom_nodes.front().size() > 0);
|
||||
|
||||
api::NearestAPI nearest_api(facade, params);
|
||||
nearest_api.MakeResponse(phantom_nodes, json_result);
|
||||
nearest_api.MakeResponse(phantom_nodes, result);
|
||||
|
||||
return Status::Ok;
|
||||
}
|
||||
|
||||
@@ -62,6 +62,12 @@ NearestService::RunQuery(std::size_t prefix_length, std::string &query, osrm::en
|
||||
}
|
||||
BOOST_ASSERT(parameters->IsValid());
|
||||
|
||||
if (parameters->format)
|
||||
{
|
||||
if (parameters->format == engine::api::BaseParameters::OutputFormatType::FLATBUFFERS) {
|
||||
result = flatbuffers::FlatBufferBuilder();
|
||||
}
|
||||
}
|
||||
return BaseService::routing_machine.Nearest(*parameters, result);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user