Skip to content

Commit

Permalink
Merge pull request #10 from frodrigo/develop
Browse files Browse the repository at this point in the history
Do u-turn on viapoint on osrm, if not the geometry do not draw the computed route
  • Loading branch information
jcoupey committed Nov 3, 2015
2 parents ac290bc + 8ba805a commit 5c37292
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/loaders/osrm_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class osrm_wrapper : public problem_io<distance_t>{
std::vector<std::pair<double, double>> _locations;

std::string build_query(const std::vector<std::pair<double, double>>& locations,
std::string service) const{
std::string service, std::string extra_args = "") const{
// Building query for osrm-routed
std::string query = "POST /" + service + "?";

Expand All @@ -49,6 +49,10 @@ class osrm_wrapper : public problem_io<distance_t>{
+ "&";
}

if(!extra_args.empty()) {
query += extra_args + "&";
}

query.pop_back(); // Remove trailing '&'.
query += " HTTP/1.1\r\n\r\n";
return query;
Expand Down Expand Up @@ -248,7 +252,7 @@ class osrm_wrapper : public problem_io<distance_t>{
}

std::string query = this->build_query(ordered_locations,
"viaroute");
"viaroute", "uturns=true");

// Other return status than 0 should have been filtered before
// with unfound routes check.
Expand Down

0 comments on commit 5c37292

Please sign in to comment.