Coder Social home page Coder Social logo

Comments (8)

karussell avatar karussell commented on June 26, 2024

Something is off in your description. Your screenshots show foot routes and your /api queries have profile=car.

As you are using 9.0-SNAPSHOT can you try this on GraphHopper Maps (and provide a link) and see if the same problems occur there?

from graphhopper.

jjeffchoi avatar jjeffchoi commented on June 26, 2024

Here is the link to GraphHopper Maps. There is an instruction to "Turn right onto Mavis road" even though you're already on Mavis road. It looks like it's because of what's seemingly a kink in the road on the map, but in reality it's just a straight road.

Here is another instance where the instruction says to "Turn right onto Dundas Street West" even though you're already on the said road and it's a straight road.

from graphhopper.

karussell avatar karussell commented on June 26, 2024

Hm, it looks like these cases happen also relative frequently in the US and other OSM routing engines can handle them without creating a separate turn instruction (at least in your highlighted case). So we should find a way to fix this.

from graphhopper.

otbutz avatar otbutz commented on June 26, 2024

Shouldn't this snippet cover the case?

// Very certain, this is a turn
if (Math.abs(sign) > 1) {
// Don't show an instruction if the user is following a street, even though the street is
// bending. We should only do this, if following the street is the obvious choice.
if (InstructionsHelper.isNameSimilar(name, prevName) && outgoingEdges.outgoingEdgesAreSlowerByFactor(2)) {
return Instruction.IGNORE;
}
return sign;
}

Edit:

outgoingEdges.outgoingEdgesAreSlowerByFactor(2)

is most likely the culprit here

from graphhopper.

otbutz avatar otbutz commented on June 26, 2024

Are there valid cases where InstructionsHelper.isNameSimilar(name, prevName) is not enough?

from graphhopper.

jjeffchoi avatar jjeffchoi commented on June 26, 2024

Thank you for looking into this. Here is maybe a better example.

GraphHopper lists 3 unnecessary instructions:

  1. Continue onto Bayview Avenue
  2. Turn right onto Bayview Avenue
  3. Turn slight right onto Bayview Avenue
  4. Turn slight right onto Bayview Avenue
  5. Arrive at destination

whereas Valhalla lists only two, which seems more intuitive for turn-by-turn:

  1. Drive north on Bayview Avenue
  2. Your destination is on the left

from graphhopper.

karussell avatar karussell commented on June 26, 2024

Thanks a lot for these examples. All those have the "split way" tagging in common associated with a lane count change (often doubling), which makes a good heuristic when to ignore these instructions. If you have time can you review my changes for your example area e.g. locally? (you'll need to add the lanes encoded value in the config graph.encoded_values: lanes)

At least all your linked examples should be fixed with this.

from graphhopper.

jjeffchoi avatar jjeffchoi commented on June 26, 2024

Works great! Thank you very much.

from graphhopper.

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.