Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapbox walking routes not matching OSM OSRM routes? #1933

Open
streetwalker-unity opened this issue Jan 15, 2025 · 4 comments
Open

Mapbox walking routes not matching OSM OSRM routes? #1933

streetwalker-unity opened this issue Jan 15, 2025 · 4 comments

Comments

@streetwalker-unity
Copy link

Hi, we are using MapBox in unity and getting really bad walking routes using this call:

https://api.mapbox.com/directions/v5/mapbox/walking/

that is: routes that cross highways where there are no crosswalks; routes that go unnecessary way around to get to the destination.

However, if we go to OpenStreetMap.org and use their map and calculate routes using the OSRM walking option to plot a route between the same start and destination as we do using the above call, we get a really good walking route that has none of those problems.

So what is the difference? Does the MapBox directions API not use OSM for its data and OSRM for its route calculations???

If not, is there any way to get the routes we see at the OpenStreetMap.org site, short of us running our own OSRM server and using that instead of MapBox for route calculation?

@1ec5
Copy link

1ec5 commented Jan 15, 2025

The Mapbox Directions API’s walking profile uses Valhalla instead of OSRM. You can tell because each instruction in English ends in a period, whereas OSRM always omits the period.

Tuning the walkway_bias parameter might help to make the routes more predictable in some cases. The default is completely neutral, which in some cities leads to routes that sometimes get off the sidewalk and into a bike lane or roadway as a shortcut. This issue also affects osm.org, so it’s possible that the issue is being compounded by something else on Mapbox’s side.

@streetwalker-unity
Copy link
Author

The Mapbox Directions API’s walking profile uses Valhalla instead of OSRM. You can tell because each instruction in English ends in a period, whereas OSRM always omits the period.

huh... last night researching this, I came across an announcement at the MapBox site stated that they are using the latest version of OSRM? I don't think I was dreaming...

So there is no choice on what calculator it uses?

Thanks for the tip about the bias!

@1ec5
Copy link

1ec5 commented Jan 15, 2025

Mapbox (née MapBox) used to power all the Directions API profiles with OSRM. Several years ago, they switched the driving and walking profiles to Valhalla. I think cycling might still use OSRM (again based on the periods in the instructions).

@streetwalker-unity
Copy link
Author

streetwalker-unity commented Jan 15, 2025

well, bias does not seem to make any difference for this specific route, from -1 on to 1 they are all the same. Thanks for all the help. Looks like we will need to set up an OSRM server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants