Adapt to JSON container rename
This commit is contained in:
parent
fd6c70afe1
commit
0e6ed53cee
@ -161,7 +161,7 @@ template <class DataFacadeT> class MapMatchingPlugin : public BasePlugin
|
||||
return true;
|
||||
}
|
||||
|
||||
int HandleRequest(const RouteParameters &route_parameters, JSON::Object &json_result) final
|
||||
int HandleRequest(const RouteParameters &route_parameters, osrm::json::Object &json_result) final
|
||||
{
|
||||
// check number of parameters
|
||||
if (!check_all_coordinates(route_parameters.coordinates))
|
||||
@ -184,7 +184,7 @@ template <class DataFacadeT> class MapMatchingPlugin : public BasePlugin
|
||||
}
|
||||
|
||||
// call the actual map matching
|
||||
JSON::Object debug_info;
|
||||
osrm::json::Object debug_info;
|
||||
Matching::SubMatchingList sub_matchings;
|
||||
search_engine_ptr->map_matching(candidates_lists, input_coords, input_timestamps, sub_matchings, debug_info);
|
||||
|
||||
@ -193,7 +193,7 @@ template <class DataFacadeT> class MapMatchingPlugin : public BasePlugin
|
||||
return 400;
|
||||
}
|
||||
|
||||
JSON::Array traces;
|
||||
osrm::json::Array traces;
|
||||
for (auto& sub : sub_matchings)
|
||||
{
|
||||
// classify result
|
||||
@ -256,17 +256,17 @@ template <class DataFacadeT> class MapMatchingPlugin : public BasePlugin
|
||||
break;
|
||||
}
|
||||
|
||||
JSON::Object temp_result;
|
||||
osrm::json::Object temp_result;
|
||||
descriptor->SetConfig(descriptor_config);
|
||||
descriptor->Run(raw_route, temp_result);
|
||||
|
||||
JSON::Array indices;
|
||||
osrm::json::Array indices;
|
||||
for (const auto& i : sub.indices)
|
||||
{
|
||||
indices.values.emplace_back(i);
|
||||
}
|
||||
|
||||
JSON::Object subtrace;
|
||||
osrm::json::Object subtrace;
|
||||
subtrace.values["geometry"] = temp_result.values["route_geometry"];
|
||||
subtrace.values["confidence"] = sub.confidence;
|
||||
subtrace.values["indices"] = indices;
|
||||
|
@ -35,8 +35,8 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
||||
|
||||
#include <fstream>
|
||||
|
||||
using JSONVariantArray = mapbox::util::recursive_wrapper<JSON::Array>;
|
||||
using JSONVariantObject = mapbox::util::recursive_wrapper<JSON::Object>;
|
||||
using JSONVariantArray = mapbox::util::recursive_wrapper<osrm::json::Array>;
|
||||
using JSONVariantObject = mapbox::util::recursive_wrapper<osrm::json::Object>;
|
||||
|
||||
template<typename T>
|
||||
T makeJSONSafe(T d)
|
||||
@ -51,19 +51,19 @@ T makeJSONSafe(T d)
|
||||
return d;
|
||||
}
|
||||
|
||||
void appendToJSONArray(JSON::Array& a) { }
|
||||
void appendToJSONArray(osrm::json::Array& a) { }
|
||||
|
||||
template<typename T, typename... Args>
|
||||
void appendToJSONArray(JSON::Array& a, T value, Args... args)
|
||||
void appendToJSONArray(osrm::json::Array& a, T value, Args... args)
|
||||
{
|
||||
a.values.emplace_back(value);
|
||||
appendToJSONArray(a, args...);
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
JSON::Array makeJSONArray(Args... args)
|
||||
osrm::json::Array makeJSONArray(Args... args)
|
||||
{
|
||||
JSON::Array a;
|
||||
osrm::json::Array a;
|
||||
appendToJSONArray(a, args...);
|
||||
return a;
|
||||
}
|
||||
@ -332,7 +332,7 @@ template <class DataFacadeT> class MapMatching final
|
||||
const std::vector<FixedPointCoordinate>& trace_coordinates,
|
||||
const std::vector<unsigned>& trace_timestamps,
|
||||
Matching::SubMatchingList& sub_matchings,
|
||||
JSON::Object& _debug_info) const
|
||||
osrm::json::Object& _debug_info) const
|
||||
{
|
||||
BOOST_ASSERT(candidates_list.size() > 0);
|
||||
|
||||
@ -344,14 +344,14 @@ template <class DataFacadeT> class MapMatching final
|
||||
return;
|
||||
}
|
||||
|
||||
JSON::Array _debug_states;
|
||||
osrm::json::Array _debug_states;
|
||||
for (unsigned t = 0; t < candidates_list.size(); t++)
|
||||
{
|
||||
JSON::Array _debug_timestamps;
|
||||
osrm::json::Array _debug_timestamps;
|
||||
for (unsigned s = 0; s < candidates_list[t].size(); s++)
|
||||
{
|
||||
JSON::Object _debug_state;
|
||||
_debug_state.values["transitions"] = JSON::Array();
|
||||
osrm::json::Object _debug_state;
|
||||
_debug_state.values["transitions"] = osrm::json::Array();
|
||||
_debug_state.values["coordinate"] = makeJSONArray(candidates_list[t][s].first.location.lat / COORDINATE_PRECISION,
|
||||
candidates_list[t][s].first.location.lon / COORDINATE_PRECISION);
|
||||
if (t < initial_timestamp)
|
||||
@ -419,7 +419,7 @@ template <class DataFacadeT> class MapMatching final
|
||||
const double transition_pr = log_transition_probability(d_t, beta);
|
||||
new_value += transition_pr;
|
||||
|
||||
JSON::Object _debug_transistion;
|
||||
osrm::json::Object _debug_transistion;
|
||||
_debug_transistion.values["to"] = makeJSONArray(t, s_prime);
|
||||
_debug_transistion.values["properties"] = makeJSONArray(
|
||||
makeJSONSafe(prev_viterbi[s]),
|
||||
@ -580,7 +580,7 @@ template <class DataFacadeT> class MapMatching final
|
||||
sub_matching_begin = sub_matching_end;
|
||||
}
|
||||
|
||||
JSON::Array _debug_breakage;
|
||||
osrm::json::Array _debug_breakage;
|
||||
for (auto b : model.breakage) {
|
||||
_debug_breakage.values.push_back(static_cast<unsigned>(b));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user