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

Hello, I'm trying to get how OSRM routing algorithm works.

I downloaded the Project-OSRM-Web-0.1.11 and I understood the client implementation of the query, but I also got the server implementation(I downloaded Project-OSRM-Develop). Compiling Project-OSRM-Web-0.1.11 in NetBeans(html compilator) I have the same result as http://map.project-osrm.org/ ; writing start/end I do a query to the server, that automatically gives me a response.

Now I'd like to see and understand better the server implementation, using my own files in Project-OSRM-Develop, and, if possible, I'd like to change something in the routing algorithms(I have my own way to weight nodes and archways). Thank you everybody

asked 28 Jan '14, 09:27

Zoifil's gravatar image

Zoifil
418811
accept rate: 0%

edited 28 Jan '14, 13:45

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554

I think it would be more useful to ask the OSRM community themself: See section "support" at http://project-osrm.org/

(28 Jan '14, 13:49) aseerel4c26 ♦

The algorithm itself is an implementation of Contraction Hierarchies.

However, if you want to change the weighting, you don't need to worry about the core routing algorithm. Instead, you need to change OSRM's "routing profile". This is a short program that takes the OpenStreetMap tags for a way (such as highway=primary, maxspeed=50) and returns the estimated speed that can be achieved on that way. From that, OSRM can work out the fastest routes.

The routing profiles are designed to be changed by those deploying OSRM, so you won't find this difficult. In your Project-OSRM directory, you'll find them in the 'profiles' directory. You'll see there are three already there: bicycle.lua, car.lua and foot.lua.

They're written in Lua, a simple, fast embedded scripting language that shouldn't be too alien if you have experience with other well-known scripting languages (Perl, PHP, Ruby, Python). Have a look at the differences between the three to see how you can adjust the weighting based on tags.

Once you've adjusted the routing profile, you simply specify it in your calls to osrm-extract and osrm-prepare. I would strongly recommend you start with a small extract (which might take 15 minutes to process), rather than a whole country or indeed the planet. Rerun it at full scale once you're happy with the results!

permanent link

answered 28 Jan '14, 14:32

Richard's gravatar image

Richard ♦
30.9k44279412
accept rate: 18%

Thank you, but how I can associate the Project-OSRM-Develop with the PRoject-OSRM-Web? I'm sorry but i had never work with a server/client application and I don't know what I have to do.

(29 Jan '14, 10:09) Zoifil
2

Project-OSRM itself is the main code that does the routing. You will need this on your own (Unix-based) server in order to do any routing with your own weightings.

Project-OSRM-Web is one possible front end. It's a set of JavaScript and HTML files that provide a browser-based route-planning interface. If you were to use it, you would download the files and host them on a webserver (such as Apache) like any other web content, making sure that you point it to your Project-OSRM instance. But you can also develop your own front-end.

(29 Jan '14, 11:09) Richard ♦
Your answer
toggle preview

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:

×305
×123
×85
×14

question asked: 28 Jan '14, 09:27

question was seen: 16,060 times

last updated: 29 Jan '14, 11:09

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