Formatted the sources
This commit is contained in:
		
							parent
							
								
									fa5567e669
								
							
						
					
					
						commit
						e97ec13064
					
				| @ -83,7 +83,8 @@ class MatchAPI final : public RouteAPI | ||||
|             route.values["confidence"] = sub_matchings[index].confidence; | ||||
|             routes.values.push_back(std::move(route)); | ||||
|         } | ||||
|         if (!parameters.skip_waypoints) { | ||||
|         if (!parameters.skip_waypoints) | ||||
|         { | ||||
|             response.values["tracepoints"] = MakeTracepoints(sub_matchings); | ||||
|         } | ||||
|         response.values["matchings"] = std::move(routes); | ||||
|  | ||||
| @ -55,11 +55,14 @@ class NearestAPI final : public BaseAPI | ||||
|             data_version_string = fb_result.CreateString(data_timestamp); | ||||
|         } | ||||
| 
 | ||||
|         flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<fbresult::Waypoint>>> waypoints_vector; | ||||
|         if (!parameters.skip_waypoints) { | ||||
|         flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<fbresult::Waypoint>>> | ||||
|             waypoints_vector; | ||||
|         if (!parameters.skip_waypoints) | ||||
|         { | ||||
|             std::vector<flatbuffers::Offset<fbresult::Waypoint>> waypoints; | ||||
|             waypoints.resize(phantom_nodes.front().size()); | ||||
|             std::transform(phantom_nodes.front().begin(), | ||||
|             std::transform( | ||||
|                 phantom_nodes.front().begin(), | ||||
|                 phantom_nodes.front().end(), | ||||
|                 waypoints.begin(), | ||||
|                 [this, &fb_result](const PhantomNodeWithDistance &phantom_with_distance) { | ||||
| @ -89,7 +92,8 @@ class NearestAPI final : public BaseAPI | ||||
|     void MakeResponse(const std::vector<std::vector<PhantomNodeWithDistance>> &phantom_nodes, | ||||
|                       util::json::Object &response) const | ||||
|     { | ||||
|         if (!parameters.skip_waypoints) { | ||||
|         if (!parameters.skip_waypoints) | ||||
|         { | ||||
|             util::json::Array waypoints; | ||||
|             waypoints.values.resize(phantom_nodes.front().size()); | ||||
|             std::transform(phantom_nodes.front().begin(), | ||||
|  | ||||
| @ -110,7 +110,8 @@ class RouteAPI : public BaseAPI | ||||
|                                                 route.target_traversed_in_reverse)); | ||||
|         } | ||||
| 
 | ||||
|         if (!parameters.skip_waypoints) { | ||||
|         if (!parameters.skip_waypoints) | ||||
|         { | ||||
|             response.values["waypoints"] = BaseAPI::MakeWaypoints(all_start_end_points); | ||||
|         } | ||||
|         response.values["routes"] = std::move(jsRoutes); | ||||
| @ -143,8 +144,10 @@ class RouteAPI : public BaseAPI | ||||
|         } | ||||
| 
 | ||||
|         auto routes_vector = fb_result.CreateVector(routes); | ||||
|         flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<fbresult::Waypoint>>> waypoints_vector; | ||||
|         if (!parameters.skip_waypoints) { | ||||
|         flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<fbresult::Waypoint>>> | ||||
|             waypoints_vector; | ||||
|         if (!parameters.skip_waypoints) | ||||
|         { | ||||
|             waypoints_vector = getWaypoints(); | ||||
|         } | ||||
| 
 | ||||
|  | ||||
| @ -84,14 +84,16 @@ class TableAPI final : public BaseAPI | ||||
|         flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<fbresult::Waypoint>>> sources; | ||||
|         if (parameters.sources.empty()) | ||||
|         { | ||||
|             if (!parameters.skip_waypoints) { | ||||
|             if (!parameters.skip_waypoints) | ||||
|             { | ||||
|                 sources = MakeWaypoints(fb_result, phantoms); | ||||
|             } | ||||
|             number_of_sources = phantoms.size(); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             if (!parameters.skip_waypoints) { | ||||
|             if (!parameters.skip_waypoints) | ||||
|             { | ||||
|                 sources = MakeWaypoints(fb_result, phantoms, parameters.sources); | ||||
|             } | ||||
|         } | ||||
| @ -100,14 +102,16 @@ class TableAPI final : public BaseAPI | ||||
|             destinations; | ||||
|         if (parameters.destinations.empty()) | ||||
|         { | ||||
|             if (!parameters.skip_waypoints) { | ||||
|             if (!parameters.skip_waypoints) | ||||
|             { | ||||
|                 destinations = MakeWaypoints(fb_result, phantoms); | ||||
|             } | ||||
|             number_of_destinations = phantoms.size(); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             if (!parameters.skip_waypoints) { | ||||
|             if (!parameters.skip_waypoints) | ||||
|             { | ||||
|                 destinations = MakeWaypoints(fb_result, phantoms, parameters.destinations); | ||||
|             } | ||||
|         } | ||||
| @ -171,28 +175,32 @@ class TableAPI final : public BaseAPI | ||||
|         // symmetric case
 | ||||
|         if (parameters.sources.empty()) | ||||
|         { | ||||
|             if (!parameters.skip_waypoints) { | ||||
|             if (!parameters.skip_waypoints) | ||||
|             { | ||||
|                 response.values["sources"] = MakeWaypoints(phantoms); | ||||
|             } | ||||
|             number_of_sources = phantoms.size(); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             if (!parameters.skip_waypoints) { | ||||
|             if (!parameters.skip_waypoints) | ||||
|             { | ||||
|                 response.values["sources"] = MakeWaypoints(phantoms, parameters.sources); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         if (parameters.destinations.empty()) | ||||
|         { | ||||
|             if (!parameters.skip_waypoints) { | ||||
|             if (!parameters.skip_waypoints) | ||||
|             { | ||||
|                 response.values["destinations"] = MakeWaypoints(phantoms); | ||||
|             } | ||||
|             number_of_destinations = phantoms.size(); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             if (!parameters.skip_waypoints) { | ||||
|             if (!parameters.skip_waypoints) | ||||
|             { | ||||
|                 response.values["destinations"] = MakeWaypoints(phantoms, parameters.destinations); | ||||
|             } | ||||
|         } | ||||
|  | ||||
| @ -81,7 +81,8 @@ class TripAPI final : public RouteAPI | ||||
|                                    sub_routes[index].target_traversed_in_reverse); | ||||
|             routes.values.push_back(std::move(route)); | ||||
|         } | ||||
|         if (!parameters.skip_waypoints) { | ||||
|         if (!parameters.skip_waypoints) | ||||
|         { | ||||
|             response.values["waypoints"] = MakeWaypoints(sub_trips, phantoms); | ||||
|         } | ||||
|         response.values["trips"] = std::move(routes); | ||||
|  | ||||
| @ -4,8 +4,8 @@ | ||||
| #include "coordinates.hpp" | ||||
| #include "fixture.hpp" | ||||
| 
 | ||||
| #include <engine/api/flatbuffers/fbresult_generated.h> | ||||
| #include "osrm/trip_parameters.hpp" | ||||
| #include <engine/api/flatbuffers/fbresult_generated.h> | ||||
| 
 | ||||
| #include "osrm/coordinate.hpp" | ||||
| #include "osrm/engine_config.hpp" | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user