itinero/routing

Bug: Targets sometimes driven to from wrong direction

Astra3141 opened this issue · 0 comments

Dear itinero team,
thanks for this library and all your work.

I'm trying to implement the current version (1.6.0-pre036) and found that sometimes Itinero decides to drive to a target from the wrong direction. This results in some detours and turnarounds.
Surprisingly its solved by telling Itinero to change the access direction for the source. But since its just a small amount of targets for which Itinero shows this behaviour its not possible to use this for all calculations.
I've tried to calculate both versions for every route and choose the shorter but this often takes a lot of time so this is no viable solution either.

Reading through other issues, I found that it helped some others to use the "TryResolveConnected"-method with "forward = true", but unfortunately that didn't change anything for me.

I've prepared an example and a routerdb and will provide it here. As profile I used Itinero.Osm.Vehicles.Vehicle.BigTruck.
Example routerdb: routerdb-220711.osm.zip

This is the base path:
Itinero 1
(The highlighted markers are source and target, the other is irrelevant)

This is the base code:

var profileInstance = RouterDb.GetSupportedProfile("bigtruck");

var source = Router.Resolve(profileInstance, 52.60404f, 8.058637f);
var target = Router.Resolve(profileInstance, 52.6047668f, 8.060073f);

var weightHandler = Router.GetDefaultWeightHandler(profileInstance);

var path = Router.TryCalculateRaw(profileInstance, weightHandler, source, null, target, null, null, CancellationToken.None);
var route = Router.BuildRoute(profileInstance, weightHandler, source, target, path.Value, CancellationToken.None).Value;

Which results in the following route:
Itinero 2

Changing it to

var path = Router.TryCalculateRaw(profileInstance, weightHandler, source, false, target, null, null, CancellationToken.None);

results in the correct route:
Itinero 3

I presume this is a bug but if I'm doing something wrong please tell me.

Thank you in advance.