NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

1
1

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 advancealt text

asked 26 Apr '17, 13:31

Alex%20taxi21's gravatar image

Alex taxi21
36113
accept rate: 0%

edited 26 Apr '17, 15:02

escada's gravatar image

escada
19.0k16166302

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 (

(27 Apr '17, 14:18) Alex taxi21

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 .

permanent link

answered 27 Apr '17, 08:53

Richard's gravatar image

Richard ♦
30.9k44279412
accept rate: 18%

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).

permanent link

answered 26 Apr '17, 21:45

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701
accept rate: 18%

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

This works https://www.openstreetmap.org/directions?engine=osrm_car&route=61.7141%2C50.7956%3B61.6808%2C50.8076#map=12/61.6972/50.8332

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

permanent link

answered 27 Apr '17, 08:26

andy%20mackey's gravatar image

andy mackey
13.2k87143285
accept rate: 4%

edited 27 Apr '17, 08:29

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×85
×6

question asked: 26 Apr '17, 13:31

question was seen: 6,469 times

last updated: 27 Apr '17, 14:35

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum