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

Null distance and duration but route is exist #5788

Closed
TeymurovFuad opened this issue Jul 29, 2020 · 3 comments · Fixed by #5828
Closed

Null distance and duration but route is exist #5788

TeymurovFuad opened this issue Jul 29, 2020 · 3 comments · Fixed by #5828

Comments

@TeymurovFuad
Copy link

TeymurovFuad commented Jul 29, 2020

Could you explain please why do I get null for distances and durations

https://router.project-osrm.org/table/v1/driving/49.81755316257477,40.39497998078589;49.8177462816238,40.3949953014633?destinations=0&annotations=distance,duration

{ "code": "Ok", "distances": [ [ 0 ], [ null ] ], "durations": [ [ 0 ], [ null ] ], "sources": [ { "hint": "X2UjgP___38IAAAAOwAAAAAAAAAAAAAASVR7QUtutUIAAAAAAAAAAAgAAAA7AAAAAAAAAAAAAADOHAEAcij4AqRhaALRJ_gC5GBoAgAArwfGoB5W", "location": [ 49.817714, 40.395172 ], "name": "Tbilisi prospekti" }, { "hint": "X2UjgP___38PAAAAOwAAAAAAAAAAAAAAmhTlQa2Tm0IAAAAAAAAAAA8AAAA7AAAAAAAAAAAAAADOHAEA8ij4AmVhaAKSKPgC82BoAgAArwfGoB5W", "location": [ 49.817842, 40.395109 ], "name": "Tbilisi prospekti" } ], "destinations": [ { "hint": "X2UjgP___38IAAAAOwAAAAAAAAAAAAAASVR7QUtutUIAAAAAAAAAAAgAAAA7AAAAAAAAAAAAAADOHAEAcij4AqRhaALRJ_gC5GBoAgAArwfGoB5W", "location": [ 49.817714, 40.395172 ], "name": "Tbilisi prospekti" } ] }

According to documentaion it is ok if htere is no route was found, but actually there is route between this points

http://router.project-osrm.org/route/v1/driving/49.81755316257477,40.39497998078589;49.8177462816238,40.3949953014633?steps=true

{"code":"Ok","waypoints":[{"hint":"r1YjgP___38IAAAAOwAAAAAAAAAAAAAASVR7QUtutUIAAAAAAAAAAAgAAAA7AAAAAAAAAAAAAACoHAEAcij4AqRhaALRJ_gC5GBoAgAArwfka4u4","location":[49.817714,40.395172],"name":"Tbilisi prospekti"},{"hint":"r1YjgP___38PAAAAOwAAAAAAAAAAAAAAmhTlQa2Tm0IAAAAAAAAAAA8AAAA7AAAAAAAAAAAAAACoHAEA8ij4AmVhaAKSKPgC82BoAgAArwfka4u4","location":[49.817842,40.395109],"name":"Tbilisi prospekti"}],"routes":[{"legs":[{"steps":[{"intersections":[{"out":0,"entry":[true],"location":[49.817714,40.395172],"bearings":[123]}],"driving_side":"right","geometry":"ytpuFu_aoHJY","duration":0.7,"distance":12.9,"name":"Tbilisi prospekti","weight":0.7,"mode":"driving","maneuver":{"bearing_after":123,"location":[49.817714,40.395172],"type":"depart","bearing_before":0,"modifier":"right"}},{"intersections":[{"in":0,"entry":[true],"location":[49.817842,40.395109],"bearings":[303]}],"driving_side":"right","geometry":"mtpuFoaoH","duration":0,"distance":0,"name":"Tbilisi prospekti","weight":0,"mode":"driving","maneuver":{"bearing_after":0,"location":[49.817842,40.395109],"type":"arrive","bearing_before":123,"modifier":"right"}}],"weight":0.7,"distance":12.9,"summary":"Tbilisi prospekti","duration":0.7}],"weight_name":"routability","geometry":"ytpuFu_aoHJY","weight":0.7,"distance":12.9,"duration":0.7}]}`

@TeymurovFuad TeymurovFuad changed the title Null distance and duration Null distance and duration but route is exist Aug 27, 2020
@demdh
Copy link

demdh commented Sep 7, 2020

Unfortunately we stumble over this problem again and again.

Example:

https://router.project-osrm.org/table/v1/driving/8.668085,50.115352;8.669070,50.115570?sources=0&destinations=1&annotations=distance,duration
{"code":"Ok","distances":[[null]],"durations":[[null]],"sources":[{"hint":"vSeviv___39vAAAAhwAAAGsAAACNAAAAJ0iUQu9TfUFtmY5CQSzmQW8AAACHAAAAawAAAI0AAABQHQEAx0OEALay_AK1Q4QAGLP8AgQAfxAZJKLf","location":[8.668103,50.115254],"name":"Kettenhofweg"}],"destinations":[{"hint":"vSeviv___38CAAAAhwAAAGsAAACNAAAAp5-3P6MUsUJtmY5CQSzmQQIAAACHAAAAawAAAI0AAABQHQEAuUeEAAGz_AKOR4QA8rP8AgQAfxAZJKLf","location":[8.669113,50.115329],"name":"Kettenhofweg"}]}

returns zero although the route exists.

If you swap the two coordinates OSRM returns a value:

https://router.project-osrm.org/table/v1/driving/8.668085,50.115352;8.669070,50.115570?sources=1&destinations=0&annotations=distance,duration
{"code":"Ok","distances":[[72.7]],"durations":[[10.9]],"sources":[{"hint":"vSeviv___38CAAAAhwAAAGsAAACNAAAAp5-3P6MUsUJtmY5CQSzmQQIAAACHAAAAawAAAI0AAABQHQEAuUeEAAGz_AKOR4QA8rP8AgQAfxAZJKLf","location":[8.669113,50.115329],"name":"Kettenhofweg"}],"destinations":[{"hint":"vSeviv___39vAAAAhwAAAGsAAACNAAAAJ0iUQu9TfUFtmY5CQSzmQW8AAACHAAAAawAAAI0AAABQHQEAx0OEALay_AK1Q4QAGLP8AgQAfxAZJKLf","location":[8.668103,50.115254],"name":"Kettenhofweg"}]}

@jcoupey
Copy link

jcoupey commented Sep 7, 2020

Looks like a duplicate of #5266.

@mjjbell
Copy link
Member

mjjbell commented Sep 8, 2020

It looks like a bug for one-way roads where a source is further down the road than the destination.

The route generated for your null distance is actually with the coordinates flipped from your example:
http://router.project-osrm.org/route/v1/driving/49.8177462816238,40.3949953014633;49.81755316257477,40.39497998078589?steps=true

And it illustrates the problem case quite well:
http://map.project-osrm.org/?z=18&center=40.395261%2C49.817972&loc=40.394995%2C49.817746&loc=40.394980%2C49.817553&hl=en&alt=0&srv=0
prospekti

From my understanding of the code, this only occurs when using the MLD algorithm for table generation where a single source or destination is selected.

Although not ideal, a temporary solution would be to ensure at least two sources and two destinations are returned and just select the parts of the result you need.
https://router.project-osrm.org/table/v1/driving/49.81755316257477,40.39497998078589;49.8177462816238,40.3949953014633?destinations=0;1&annotations=distance,duration

I'd need to understand the code a bit better before attempting a fix, but it looks like some additional edge-case handling is needed when the source and destination nodes have this relationship.

mjjbell added a commit to mjjbell/osrm-backend that referenced this issue Sep 11, 2020
Fixes Project-OSRM#5788

Table queries where source and destinaton are phantom nodes
on the same one-way segment can fail to find valid routes.

This is due to a bug in the MLD table generation for the
special case where the query can be simplified to a
one-to-many search.
If the destination is before the source on the one-way segment,
it will fail to find a route.

We fix this case by not marking the node as visited, so that
valid paths to this node can be found later in the search.

We also remove redundant initialization for the source
node as the same actions are performed by a search step.
mjjbell added a commit to mjjbell/osrm-backend that referenced this issue Sep 11, 2020
Fixes Project-OSRM#5788

Table queries where source and destinaton are phantom nodes
on the same one-way segment can fail to find valid routes.

This is due to a bug in the MLD table generation for the
special case where the query can be simplified to a
one-to-many search.
If the destination is before the source on the one-way segment,
it will fail to find a route.

We fix this case by not marking the node as visited, so that
valid paths to this node can be found later in the search.

We also remove redundant initialization for the source
node as the same actions are performed by a search step.
mjjbell added a commit to mjjbell/osrm-backend that referenced this issue Sep 12, 2020
Fixes Project-OSRM#5788

Table queries where source and destinaton are phantom nodes
on the same one-way segment can fail to find valid routes.

This is due to a bug in the MLD table generation for the
special case where the query can be simplified to a
one-to-many search.
If the destination is before the source on the one-way segment,
it will fail to find a route.

We fix this case by not marking the node as visited, so that
valid paths to this node can be found later in the search.

We also remove redundant initialization for the source
node as the same actions are performed by a search step.
mjjbell added a commit to mjjbell/osrm-backend that referenced this issue Sep 12, 2020
Fixes Project-OSRM#5788

Table queries where source and destinaton are phantom nodes
on the same one-way segment can fail to find valid routes.

This is due to a bug in the MLD table generation for the
special case where the query can be simplified to a
one-to-many search.
If the destination is before the source on the one-way segment,
it will fail to find a route.

We fix this case by not marking the node as visited at the start,
so that valid paths to this node can be found later in the search.

We also remove redundant initialization for the source
node as the same actions are performed by a search step.
mjjbell added a commit to mjjbell/osrm-backend that referenced this issue Sep 12, 2020
Fixes Project-OSRM#5788

Table queries where source and destinaton are phantom nodes
on the same one-way segment can fail to find valid routes.

This is due to a bug in the MLD table generation for the
special case where the query can be simplified to a
one-to-many search.
If the destination is before the source on the one-way segment,
it will fail to find a route.

We fix this case by not marking the node as visited at the start,
so that valid paths to this node can be found later in the search.

We also remove redundant initialization for the source
node as the same actions are performed by a search step.
mjjbell added a commit to mjjbell/osrm-backend that referenced this issue Sep 12, 2020
Fixes Project-OSRM#5788

Table queries where source and destination are phantom nodes
on the same one-way segment can fail to find valid routes.

This is due to a bug in the MLD table generation for the
special case where the query can be simplified to a
one-to-many search.
If the destination is before the source on the one-way segment,
it will fail to find a route.

We fix this case by not marking the node as visited at the start,
so that valid paths to this node can be found later in the search.

We also remove redundant initialization for the source
node as the same actions are performed by a search step.
mjjbell added a commit to mjjbell/osrm-backend that referenced this issue Sep 12, 2020
Fixes Project-OSRM#5788

Table queries where source and destination are phantom nodes
on the same one-way segment can fail to find valid routes.

This is due to a bug in the MLD table generation for the
special case where the query can be simplified to a
one-to-many search.
If the destination is before the source on the one-way segment,
it will fail to find a route.

We fix this case by not marking the node as visited at the start,
so that valid paths to this node can be found later in the search.

We also remove redundant initialization for the source
node as the same actions are performed by a search step.
mjjbell added a commit to mjjbell/osrm-backend that referenced this issue Sep 12, 2020
Fixes Project-OSRM#5788

Table queries where source and destination are phantom nodes
on the same one-way segment can fail to find valid routes.

This is due to a bug in the MLD table generation for the
special case where the query can be simplified to a
one-to-many search.
If the destination is before the source on the one-way segment,
it will fail to find a route.

We fix this case by not marking the node as visited at the start,
so that valid paths to this node can be found later in the search.

We also remove redundant initialization for the source
node as the same actions are performed by a search step.
mjjbell added a commit to mjjbell/osrm-backend that referenced this issue Sep 12, 2020
Fixes Project-OSRM#5788

Table queries where source and destination are phantom nodes
on the same one-way segment can fail to find valid routes.

This is due to a bug in the MLD table generation for the
special case where the query can be simplified to a
one-to-many search.
If the destination is before the source on the one-way segment,
it will fail to find a route.

We fix this case by not marking the node as visited at the start,
so that valid paths to this node can be found later in the search.

We also remove redundant initialization for the source
node as the same actions are performed by a search step.
mjjbell added a commit to mjjbell/osrm-backend that referenced this issue Sep 12, 2020
Fixes Project-OSRM#5788

Table queries where source and destination are phantom nodes
on the same one-way segment can fail to find valid routes.

This is due to a bug in the MLD table generation for the
special case where the query can be simplified to a
one-to-many search.
If the destination is before the source on the one-way segment,
it will fail to find a route.

We fix this case by not marking the node as visited at the start,
so that valid paths to this node can be found later in the search.

We also remove redundant initialization for the source
node as the same actions are performed by a search step.
mjjbell added a commit to mjjbell/osrm-backend that referenced this issue Sep 12, 2020
Fixes Project-OSRM#5788

Table queries where source and destination are phantom nodes
on the same one-way segment can fail to find valid routes.

This is due to a bug in the MLD table generation for the
special case where the query can be simplified to a
one-to-many search.
If the destination is before the source on the one-way segment,
it will fail to find a route.

We fix this case by not marking the node as visited at the start,
so that valid paths to this node can be found later in the search.

We also remove redundant initialization for the source
node as the same actions are performed by a search step.
mjjbell added a commit to mjjbell/osrm-backend that referenced this issue Sep 12, 2020
Fixes Project-OSRM#5788

Table queries where source and destination are phantom nodes
on the same one-way segment can fail to find valid routes.

This is due to a bug in the MLD table generation for the
special case where the query can be simplified to a
one-to-many search.
If the destination is before the source on the one-way segment,
it will fail to find a route.

We fix this case by not marking the node as visited at the start,
so that valid paths to this node can be found later in the search.

We also remove redundant initialization for the source
node as the same actions are performed by a search step.
mjjbell added a commit to mjjbell/osrm-backend that referenced this issue Sep 12, 2020
Fixes Project-OSRM#5788

Table queries where source and destination are phantom nodes
on the same one-way segment can fail to find valid routes.

This is due to a bug in the MLD table generation for the
special case where the query can be simplified to a
one-to-many search.
If the destination is before the source on the one-way segment,
it will fail to find a route.

We fix this case by not marking the node as visited at the start,
so that valid paths to this node can be found later in the search.

We also remove redundant initialization for the source
node as the same actions are performed by a search step.
mjjbell added a commit to mjjbell/osrm-backend that referenced this issue Sep 19, 2020
Fixes Project-OSRM#5788

Table queries where source and destination are phantom nodes
on the same one-way segment can fail to find valid routes.

This is due to a bug in the MLD table generation for the
special case where the query can be simplified to a
one-to-many search.
If the destination is before the source on the one-way segment,
it will fail to find a route.

We fix this case by not marking the node as visited at the start,
so that valid paths to this node can be found later in the search.

We also remove redundant initialization for the source
node as the same actions are performed by a search step.
danpat pushed a commit that referenced this issue Oct 7, 2020
…5828)

Fixes #5788

Table queries where source and destination are phantom nodes
on the same one-way segment can fail to find valid routes.

This is due to a bug in the MLD table generation for the
special case where the query can be simplified to a
one-to-many search.
If the destination is before the source on the one-way segment,
it will fail to find a route.

We fix this case by not marking the node as visited at the start,
so that valid paths to this node can be found later in the search.

We also remove redundant initialization for the source
node as the same actions are performed by a search step.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants