Giter Club home page Giter Club logo

Comments (3)

jcoupey avatar jcoupey commented on May 27, 2024

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.

danpat avatar danpat commented on May 27, 2024

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

A few things are confounding each other here:

  1. OSRM finds the distance to the nearest edges and sorts them by distance, and picks the nearest.
  2. 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.
  3. This coordinate looks to be dropped near an intersection - mapping precision is not in the sub-mm range.
  4. It's working out that OSRM thinks it is closest to the outgoing road heading south-east.
  5. By default, u-turns are not performed at waypoints in the car profile.

There are a few ways to address the problem:

  1. Move the coordinate a bit so it's not so close to an ambiguous point.
  2. Add continue_straight=false to your API calls (although you'll still get some funny instructions about turning left, etc along the way)
  3. 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
  4. If this happens to you a lot, and your routes are short, try using the /matching API instead along with the waypoints= parameter - it kind of performs the logic in (3) and you can probably get OK results.

from osrm-backend.

N40 avatar N40 commented on May 27, 2024

@jcoupey Thanks for the hint to investigate the weight

I found out that there is a 3000ish weight surplus due to a single road being entered. Here is an example where a detour an alternative detour is thus viable.

http://router.project-osrm.org/route/v1/driving/10.908039808273315,49.89198032006379;10.908088088035583,49.89192848119509

Screenshot 2024-05-02 at 10 29 37

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.