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.
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)
- Maxheight for cars is still too high HOT 1
- Allow routing by foot along `public_transport=platform` or `railway=platform` or `highway=platform`
- How much will this impact my api request analysis, will it be significant ?-----[warn] Level 1 unreachable boundary nodes per cell...
- What's the correct way to specify the bearing for routes?
- more performance HOT 10
- osrm-backend-5.27.1 not compiling on Sonoma14.2 on MacBook Air HOT 8
- 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
- error while running osrm with shared memory HOT 1
- OSRM-BACKEND ON CENTOS9 / ALMALINUX 9 HOT 1
- 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
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.