Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do u-turn on viapoint on osrm, if not the geometry do not draw the computed route #10

Merged
merged 1 commit into from
Nov 3, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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