routing icon indicating copy to clipboard operation
routing copied to clipboard

Invalid Route detecting

Open mukeshrebari opened this issue 4 years ago • 6 comments

I am unable to use this library as it is detecting wrong route in 40% cases. can someone tell what wrong i am doing.

here is result of one case geojson link. below is the sample code : image

bellow is the switches i passed to generate routerdb from osm pbf idp --read-pbf E:\Geo\india_osm.pbf --pr --create-routerdb vehicles=bicycle,pedestrian,car,bigtruck,smalltruck --contract car.shortest --contract car --contract bigtruck.shortest --write-routerdb E:\Geo\india_shortest.routerdb

The issue is if vehicle is travelling through LAN1(upward direction) suppose, but this library resolve it on LAN2(downward direction). see the below snap Choosen Wrong waypoint green checked is what correct and red cross is wrong and is also point resolved by this library.

google gives correct route https://www.google.com/maps/dir/26.596151+74.874098/26.578853+74.818142/@26.5941986,74.8423378,16z/data=!4m9!4m8!1m3!2m2!1d74.874098!2d26.596151!1m3!2m2!1d74.818142!2d26.578853

mukeshrebari avatar Dec 08 '19 19:12 mukeshrebari

Suppose we have four points A->B->C->D in forward direction. And Itinero should resolve Points on LAN1 i.e. LEFT LAN(OneWay), but in actual Itinero resolve them as below:

A: LAN1 [LEFT Road(OneWay)] (Correct Resolved) B: LAN2 [RIGHT Road(OneWay)] (Wrong Resolved, it should be resolved on LAN1) C: LAN2 [RIGHT Road(OneWay)] (Wrong Resolved, it should be resolved on LAN1) D:LAN1 [LEFT Road(OneWay)](Correct Resolved)

mukeshrebari avatar Dec 11 '19 09:12 mukeshrebari

anyone who could reply my query?

mukeshrebari avatar Dec 19 '19 17:12 mukeshrebari

The resolving function tricky, it does not take into account anything else but the location.

What is the issue exactly? Are points being resolved on the incorrect lane while the coordinate is directly above that lane? Is it an option to improve the location of the coordinates?

Can you give me the coordinates of a resolve that fails together with where it should resolve?

xivk avatar Dec 19 '19 18:12 xivk

Hi Ben Abelshausen, Thanks for reply. i'll try to explain things.

What is the issue exactly? Are points being resolved on the incorrect lane while the coordinate is directly above that lane?

yes, point are being resolved on the incorrect lane. Coordinate(lat:26.596151,long:74.874098) to be resolved and itinero resolved as this Coordinate(lat:26.596212,long:74.87421) RouteDb_Result_GeoJson_link Vehicle was traveling from Point A to Point D via Point B and Point C link.

And you can find google resolve it correctly as I need google_link

Is it an option to improve the location of the coordinates? may be, if we find how google is resolving it on correct lane, like guessing travelling direction and shortest path.

Also, would like to know why Itinero has decided to do this image RouteDb_Result_link

mukeshrebari avatar Dec 30 '19 10:12 mukeshrebari

@mukeshrebari, have you tried calling TryResolveConnected passing true for forward? In some tests I have run it seems to help but not always:

//Try to resolve the point connected to the route going forward
						var resolved = routingClient.TryResolveConnectedPoint((float)ll.Lat, (float)ll.Long, 2000, 1000, true);

						//If there was an error then use the normal resolve
						if (resovled.IsError)
						{
							resovled = routingClient.TryResolvePoint((float)ll.Lat, (float)ll.Long, 1000);

							//If still an error than discard it
							if (resovled.IsError) continue;
						}

juliusfriedman avatar Mar 10 '20 18:03 juliusfriedman

Hi @juliusfriedman , Thanks for reply. I would try it and let you know.

mukeshrebari avatar Mar 15 '20 14:03 mukeshrebari