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

Nearest Service returning an incorrect node ID of 0 #5415

Open
chaupow opened this issue Mar 28, 2019 · 6 comments
Open

Nearest Service returning an incorrect node ID of 0 #5415

chaupow opened this issue Mar 28, 2019 · 6 comments

Comments

@chaupow
Copy link
Member

chaupow commented Mar 28, 2019

When requesting \nearest we often find the annotation of nodes returning an incorrect node ID of 0.
We're seeing a node ID 0 in about 17% of all requests.

Example:

https://router.project-osrm.org/nearest/v1/driving/13.5077,52.5643

Response:

{
  "waypoints": [
    {
      "nodes": [0, 536784367],
      "hint": "RdUOif___38BAAAAYgAAAAAAAACyAAAAJ1ZePxQrG0IAAAAAtpaPQgEAAAAxAAAAAAAAAFkAAABvpgAAcRzOAE8RIgN0HM4ATBEiAwAA7w4PM8D1",
      "distance": 0.39091554070843676,
      "name": "Falkenberger Chaussee",
      "location": [13.507697, 52.564303]
    }
  ],
  "code": "Ok"
}

Expected Behaviour

Instead of node ID 0, we would expect 536784687

@chaupow
Copy link
Member Author

chaupow commented Mar 29, 2019

capturing per chat with @daniel-j-h:

https://github.com/Project-OSRM/osrm-backend/blob/master/include/engine/api/nearest_api.hpp#L47
this is where you need to go in and debug it

Gp2mv3 added a commit to cParkApp/osrm-backend that referenced this issue Jul 17, 2019
@Gp2mv3
Copy link

Gp2mv3 commented Jul 17, 2019

Hey,
We changed slightly the code of node retrieval here: https://github.com/cParkApp/osrm-backend/tree/fix-OSM-nodes
We are testing internally but our first tests are working fine.

Don't hesitate to try our code.

@yfyf
Copy link

yfyf commented Aug 16, 2019

I'm also observing the behaviour that around ~10% of the responses contain an invalid 0 node id. Additionally, some responses contain only a single node (which can't define a waypoint, right?)

I've tried running @Gp2mv3's fix-OSM-nodes branch and it indeed resolves the issue - it always returns 2 or more valid nodes.

However, it was my understanding that originally the Nearest service returned the two nodes which correspond to the nearest segment. With the patch, it seems to simply return all nodes that define the whole (nearest) way?

@Gp2mv3
Copy link

Gp2mv3 commented Aug 16, 2019

However, it was my understanding that originally the Nearest service returned the two nodes which correspond to the nearest segment. With the patch, it seems to simply return all nodes that define the whole (nearest) way?

Indeed, that's exactly the behaviour I wanted. It seems more logical, no?

@yfyf
Copy link

yfyf commented Aug 16, 2019

Indeed, that's exactly the behaviour I wanted. It seems more logical, no?

Hmm, not sure, because at least in my usecase I'm interested in identifying the actual closest segment, not the whole way (which might be huge). Returning all the nodes for the way is also kind of redundant, because the caller might as well get just the way_id instead and lookup the nodes themselves.

@RuiLoureiro
Copy link

I'm still observing this behaviour. Any new information on this issue?

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

No branches or pull requests

4 participants