Our administrators install OSRM v5. I try build the shortest route. uri: /route/v1/driving/50.792940,61.659061;50.798636,61.665437;50.811901,61.669517;50.768080,61.730977 server return faster route (about 11,5 km) and i can`t find how build shortest route (aboute 10 km). Can i do this by options in request string or need change config on server. Or it is not possible. thank you in advance asked 26 Apr '17, 13:31 Alex taxi21 escada |
To get the shortest route, you will need to create a custom profile (a .lua file) where all roads are weighted at the same speed. The routing algorithm will then choose a 5-mile unclassified road (at 60mph) in preference to a 6-mile trunk road (at 60mph), whereas the standard car.lua will choose a 6-mile trunk road at 60mph in preference to a 5-mile unclassified road at 40mph. You will need to specify the path to your profile in the command line when calling osrm-extract. I would recommend starting with car.lua and modifying it rather than creating a new profile from scratch. As Andy has mentioned, I gave a brief overview of OSRM's profiles at https://help.openstreetmap.org/questions/30272/how-the-routing-osrm-algorithm-works . answered 27 Apr '17, 08:53 Richard ♦ |
Note: this is not from first hand experience. OSRM always only has one profile per instance, at least when it is run in normal CH mode. And, as far as I know, the standard setup optimizes drive time, not distance. In other words you would have to set up an instance that uses the travelled distance as the metric (which I assume is possible, bat may be not easy). answered 26 Apr '17, 21:45 SimonPoole ♦ Can you tell more about travelled distance as the metric? I tried build alternative routes by options, but OSRM always build only that route for points like in picture
(27 Apr '17, 07:51)
Alex taxi21
|
but if i extend the route south a small amount https://www.openstreetmap.org/directions?engine=osrm_car&route=61.7141%2C50.7956%3B61.6759%2C50.8092#map=12/61.6951/50.8095 the route takes the detour you have found. The obvious route your dotted one as a 60kph speed limit mapped the used alternative as no limit set. Maybe osrm calculates that as slower because of the 60kph answered 27 Apr '17, 08:26 andy mackey 2
Richard's answer here may help you https://help.openstreetmap.org/questions/30272/how-the-routing-osrm-algorithm-works
(27 Apr '17, 08:49)
andy mackey
|
Thank you for your responses )
It is a pity that can not just ask the OSRM option in the query to build the shortest route (