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

Bug: Targets sometimes driven to from wrong direction #359

Open
Astra3141 opened this issue Sep 12, 2022 · 0 comments
Open

Bug: Targets sometimes driven to from wrong direction #359

Astra3141 opened this issue Sep 12, 2022 · 0 comments

Comments

@Astra3141
Copy link

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.

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

No branches or pull requests

1 participant