I didn’t check the demo route till now, but it actually takes the best route. Mine doesn’t for some reason.
On my server, best route is given as an alternative which is OK with me. The reason I can’t is that if I enable alternative routes, with distances over 50 miles and near cities, it takes so long that users think the app is broken. Thus I had to disable alternative. Now they cry the route isn’t ideal. I can’t win
Either way it would be nice to provide alternative routes at a reasonable speed like 1-2 seconds for a 80 mile/128 kilometer route. Hopefully landmarks can do that.
Yes it works with landmarks. Just make sure not to confuse landmarks=ALT(“A-Star,Landmarks,Triangular inequality”) with alternative routes.
Thanks for providing this example. Alternative route calculations use some heuristics so the outcome might be bad sometimes. In any case its helpful to collect such examples when trying to improve. You can also try to increase alternative_route.max_paths to get more alternatives and sort/filter them by distance or something.
What do you mean “It doesn’t seem to be working”? Do you mean you get only one route? What happens when you try different routes (change start/end markers)? Also try disable.lm=true to disable landmarks. With this you should get the same result as before, but a slower response.
It wasn’t providing alternative routes, but it’s all working now. I was using v1, and updated to v2. It provides alternatives at light speed. Plus the “best” route according to my user is now being used. Seems that Graphhopper development is going just as fast
I did find one where the alternative route took a residential road instead of going a bit further and using secondary/tertiary roads which seemed more logical. Obviously that’s what it’s supposed to do, but I’m hoping to modify it.
I looked at weighting.md and ShortFastestWeighting.java to see if I could slightly adjust it, but some of my brain cells popped when I tried
I wonder if you might point me in the right direction? How would I get it to prefer higher road classifications which is actually faster due to turns/speed limits?
I also tried messing with short_fastest.distance_factor, but it never took a different route. I tried setting it to 0.0, 1.0 and everything in between. I couldn’t get it to choose the tertiary road.