Comments (3)
You're only reporting route duration
values, but internally OSRM miminizes weight
, which can differ from duration
. The purpose of weight
is to be able to apply penalties in the profile while not messing with actual travel times.
What you're seeing is that for the route you get, duration
and weight
are identical, while for the alternatives weight
is much higher despite duration
being smaller.
So it is definitely not an OSRM bug, it's more related to the weighting decisions inside the routing profile. This is what would need investigating if you think the profile can be improved in some way. Maybe worth looking closely at the debug map around that area.
from osrm-backend.
I think the main issue here is around what to do when a point is dropped close to an intersection.
![Screenshot 2024-04-30 at 2 33 28 am](https://private-user-images.githubusercontent.com/1892250/326747592-2065ea83-2a54-45b1-bb80-7f32287708a5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTY3ODUzNDgsIm5iZiI6MTcxNjc4NTA0OCwicGF0aCI6Ii8xODkyMjUwLzMyNjc0NzU5Mi0yMDY1ZWE4My0yYTU0LTQ1YjEtYmI4MC03ZjMyMjg3NzA4YTUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDUyNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA1MjdUMDQ0NDA4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YThiZmY4NjY0NGMxZTdiM2I1Yzg0ZjQwMWY1NTczODk3Mzk4NjQxOGVjYmZiMjM1MTM5ZTM0NmM4ZGE2NzM5MiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ._DR1Obm3fdhQGANB-LnSj1_x0wWvcTjoXeYuJetqFhI)
A few things are confounding each other here:
- OSRM finds the distance to the nearest edges and sorts them by distance, and picks the nearest.
- It doesn't care about precision - if the math says it's 0.01mm closer, it'll pick that. If there are several edges that are equi-distant, then the one picked depends on the packing order in the R-Tree that we searched, which is effectively random.
- This coordinate looks to be dropped near an intersection - mapping precision is not in the sub-mm range.
- It's working out that OSRM thinks it is closest to the outgoing road heading south-east.
- By default, u-turns are not performed at waypoints in the
car
profile.
There are a few ways to address the problem:
- Move the coordinate a bit so it's not so close to an ambiguous point.
- Add
continue_straight=false
to your API calls (although you'll still get some funny instructions about turning left, etc along the way) - In theory, OSRM could do some special handling when we snap very close to the start of an edge - we could add several nearby edges as potential candidates for the destination. This old ticket kind of describes the problem and what needs to get implemented: #3991
- If this happens to you a lot, and your routes are short, try using the
/matching
API instead along with thewaypoints=
parameter - it kind of performs the logic in (3) and you can probably get OK results.
from osrm-backend.
@jcoupey Thanks for the hint to investigate the weight
I found out that there is a 3000
ish weight surplus due to a single road being entered. Here is an example where a detour an alternative detour is thus viable.
I suppose that either of
access = permissive
highway = service
vehicle = destination
is causing the penalty.
I will look into using weight='duration'
as profile.
Thank you!
from osrm-backend.
Related Issues (20)
- Getting country data
- OSRM Conda package on conda-forge? HOT 1
- POST
- Link to docker repo in README.md is out of date.
- Segment of road not considered for routing - why? HOT 2
- Elevation aware routing (avoid uphill routes)
- Questions about map matching
- Return elevation data in OSRM response HOT 3
- error while running osrm with shared memory HOT 1
- OSRM-BACKEND ON CENTOS9 / ALMALINUX 9 HOT 2
- Build failure with Boost 1.85.0 due to convenience.hpp removal
- Improvements to forcing loops during graph search HOT 5
- cmake can't compile the source code HOT 1
- Which speed overwrites the others
- Spurious sanitizer failure in CI runs
- osrm-extract fails to execute HOT 1
- Compilation errors on Linux HOT 1
- Exclude toll not working with alternative=true
- Fix performance-type-promotion-in-math-fn and readability-container-contains clang-tidy warnings
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from osrm-backend.