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

Already on GitHub? Sign in to your account

make alternative route optional? #357

Closed
karme opened this Issue Aug 3, 2012 · 23 comments

Comments

Projects
None yet
6 participants

karme commented Aug 3, 2012

maybe it would be a good idea to make the alternative route calculation optional as it is quite slow at the moment?

Contributor

DennisOSRM commented Aug 5, 2012

The alternative should not pose a bottleneck. Not sure what you mean by quite slow

Also, are you refering to the actual computation on the server or the subsequent handling on the client?

karme commented Aug 8, 2012

DennisSchiefer
reply@reply.github.com
writes:

Also, are you refering to the actual computation on the server or the
subsequent handling on the client?

on the server
small test:

patch introducing alt=false:

diff --git a/Plugins/ViaRoutePlugin.h b/Plugins/ViaRoutePlugin.h
index 01f4afe..8fb24e2 100644
--- a/Plugins/ViaRoutePlugin.h
+++ b/Plugins/ViaRoutePlugin.h
@@ -127,8 +127,8 @@ public:
segmentPhantomNodes.targetPhantom = phantomNodeVector[i+1];
rawRoute.segmentEndCoordinates.push_back(segmentPhantomNodes);
}

  •    if(1 == rawRoute.segmentEndCoordinates.size()) {
    
    -// INFO("Checking for alternative paths");
  •    if((routeParameters.options.Find("alt") != "false") && (1 == rawRoute.segmentEndCoordinates.size())) {
    
  •       INFO("Checking for alternative paths");
         searchEngine->alternativePaths(rawRoute.segmentEndCoordinates[0],  rawRoute);
    
     } else {
    

test with long route:

$ time curl -o /dev/null -s -w '\nstat: %{time_total} %{time_namelookup} %{time_connect} %{time_pretransfer} %{time_redirect} %{time_starttransfer} %{speed_download}\n' "http://localhost:5001/viaroute?loc=43.4529,-0.3955&loc=49.2678,15.9960&instructions=false&alt=true"
stat: 29.183 0.001 0.001 0.001 0.000 29.182 4421.000
real 0m29.193s
user 0m0.004s
sys 0m0.004s

$ time curl -o /dev/null -s -w '\nstat: %{time_total} %{time_namelookup} %{time_connect} %{time_pretransfer} %{time_redirect} %{time_starttransfer} %{speed_download}\n' "http://localhost:5001/viaroute?loc=43.4529,-0.3955&loc=49.2678,15.9960&instructions=false&alt=false"
stat: 0.062 0.001 0.001 0.001 0.000 0.061 1068743.000
real 0m0.072s
user 0m0.008s
sys 0m0.000s

=> using alternative search 29s elapsed before data transfer starts

can anybody reproduce this?

Contributor

DennisOSRM commented Aug 13, 2012

I cannot reproduce this.

karme commented Aug 20, 2012

looks like it depends on speedprofile used - to reproduce one has to use a "foot" profile

Contributor

DennisOSRM commented Aug 20, 2012

Still not sure where this comes from. Can you share your profile?

On 20.08.2012 13:26, karme wrote:

looks like it depends on speedprofile used - to reproduce one has to use
a "foot" profile


Reply to this email directly or view it on GitHub
DennisOSRM#357 (comment).

Contributor

emiltin commented Aug 20, 2012

not sure it's related but... something i find can slow down the UI is to create a very long route, and then zooming all the way in. since the line generalization (compression) depends on zoom level, you get a lot of data back when you're zoomed in, but most of it will be outside the map window.

Contributor

emiltin commented Aug 20, 2012

Contributor

DennisOSRM commented Aug 20, 2012

On 20.08.2012 13:38, Emil Tin wrote:

not sure it's related but... something i find can slow down the UI is to
create a very long route, and then zooming all the way in. since the
line generalization (compression) depends on zoom level, you get a lot
of data back when you're zoomed in, but most of it will be outside the
map window.

This is an unrelated issue. Please don't mix discussions as users may
get distracted about the origin of issues.

Contributor

emiltin commented Aug 20, 2012

sorry, i added it because it though it could perhaps be a clue

Contributor

DennisOSRM commented Aug 20, 2012

On 20.08.2012 13:39, karme wrote:

the speedprofile:

https://github.com/karme/Project-OSRM/blob/95c53868abb32dc4cba3a922f32c645be7c6cff9/speedprofile.ini

Thanks, will look into.

Contributor

DennisOSRM commented Oct 2, 2012

@karme are you still seeing this issue with the latest version from develop branch?

karme commented Oct 25, 2012

Project OSRM notifications@github.com writes:

@karme are you still seeing this issue with the latest version from
develop branch?

looks good:

$ time curl -o /dev/null -s -w '\nstat: %{time_total} %{time_namelookup} %{time_connect} %{time_pretransfer} %{time_redirect} %{time_starttransfer} %{speed_download}\n' "http://localhost:5001/viaroute?loc=43,0&loc=50,16&instructions=false&alt=true"
stat: 0.087 0.000 0.000 0.000 0.000 0.087 1281316.000
real 0m0.096s
user 0m0.000s
sys 0m0.008s
$ time curl -o /dev/null -s -w '\nstat: %{time_total} %{time_namelookup} %{time_connect} %{time_pretransfer} %{time_redirect} %{time_starttransfer} %{speed_download}\n' "http://localhost:5001/viaroute?loc=43,0&loc=50,16&instructions=false&alt=false"
stat: 0.036 0.001 0.001 0.001 0.000 0.036 1454601.000
real 0m0.046s
user 0m0.008s
sys 0m0.000s

Contributor

DennisOSRM commented Oct 25, 2012

Thanks for the feedback. Closing the issue.

@DennisOSRM DennisOSRM closed this Oct 25, 2012

Contributor

DennisOSRM commented Oct 26, 2012

I added your suggestion to omit the alternative with '&alt=false'.

karme commented Oct 28, 2012

Project OSRM notifications@github.com writes:

Thanks for the feedback. Closing the issue.

sorry, tested using the wrong profile.

using the foot profile, the issue is still there:

$ time curl -o /dev/null -s -w '\nstat: %{time_total} %{time_namelookup} %{time_connect} %{time_pretransfer} %{time_redirect} %{time_starttransfer} %{speed_download}\n' "http://localhost:5001/viaroute?loc=43,0&loc=50,16&instructions=false&alt=true"
stat: 20.847 0.001 0.001 0.001 0.000 20.846 8185.000
real 0m20.856s
user 0m0.004s
sys 0m0.004s
$ time curl -o /dev/null -s -w '\nstat: %{time_total} %{time_namelookup} %{time_connect} %{time_pretransfer} %{time_redirect} %{time_starttransfer} %{speed_download}\n' "http://localhost:5001/viaroute?loc=43,0&loc=50,16&instructions=false&alt=false"
stat: 0.056 0.001 0.001 0.001 0.000 0.056 1613171.000
real 0m0.067s
user 0m0.004s
sys 0m0.008s

don't know how to re-open the issue - can you do it please?

karme commented Oct 28, 2012

Project OSRM notifications@github.com writes:

I added your suggestion to omit alternative with '&alt=false'.

ok, thanks!

@DennisOSRM DennisOSRM reopened this Oct 29, 2012

Contributor

DennisOSRM commented Oct 29, 2012

Reopened for further investigation

Contributor

emiltin commented Jan 29, 2013

still a problem?

karme commented Jan 30, 2013

alternative routes are optional now => close
will create a new issue for slow alternative routes

@karme karme closed this Jan 30, 2013

sanju74 commented May 23, 2015

Hello, Is it possible to get minimum one alternate route using routing API. Now we have option if we need alternate route or not can we have option to specify minimum 1,2,3 alternate route? Thanks!

woodbri commented May 23, 2015

@sanju74 No, currently you can ask for an alternate route and IF one can be found it will be returned. Only one alternate is looked for and it is possible that no alternates will be found. There are specific rules for deciding what is an alternate route, but I don't remember all the details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment