-
Notifications
You must be signed in to change notification settings - Fork 71
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
Considerable difference between contracted and non-contracted routes #311
Comments
Possible duplicate of #267? |
To be able to use this routing library, routing with contracted profiles must generate the correct route. |
this requires the newest develop instance of Reminisce, the problem is that locking was not occurring for reading on Index's. after the latest develop is built you can link that to the build I reference below and should not experience this. See also Be weary I had some issues with contractions with the Change on MaxDistanceSplitter So if you have issue contracting see: |
I've tried with the latest develop instance of Reminiscence with the same result. I've also tried with the latest develop instance of OsmSharp, Itinero.IO.Osm and Itinero as well, but still the same result. I've attached two routerdb databases which can be used to reproduce the issue. Using the "car.classifications" profile, the routerdb "norway-extract.osm.routerdb" and "norway-extract-contracted.osm.routerdb" with the following coordinates will reproduce the issue: Start latitude: 68.86135 Stop latitude: 69.3911362 |
Can you try on #302 and by linking Reminiscence with it locally? Let me know if you still have issues and I will take a look |
I've tried your branch in #302 and linked develop of Reminiscence, but the result is the same. If you try the router databases attached above you can easily reproduce the issue. |
When contracting the profile after loading the OSM data without restrictions and using the AugmentedWeightHandler, the route is correctly calculated. So it seems that contracted profiles with restrictions is the problem here. |
Is there any progress on this issue? |
I d k, @xivk hasn't been around here for some time, he was active in OsmSharp where my PR was merged and the version was increased OsmSharp/core#101. Is there anyway I can be of assistance? Are you using Turn based routing? |
P.s. I think you can also fix this in There's definitely improvement as the Weight class offers more than I am using here. //295
//Todo hope this is correct but tis seems the GetAugmentedWeightHandler is not really used afaik
//Allocations may be heavy here
if (_router.Db.HasContractedFor(_profile.Profile))
{
var weightsResult = _router.TryCalculateWeight(_profile, _router.GetAugmentedWeightHandler(_profile), locations);
var v = weightsResult.Value;
_weights = new float[v.Length][];
for (int i = 0, e = v.Length; i < e; ++i)
{
int j = v[i].Length;
_weights[i] = new float[j];
for (; j >= 0; --j)
{
_weights[i][j] = v[i][j].Value;
}
}
}
else
{
var weightsResult = _router.TryCalculateWeight(_profile, _weightHandler, locations, locations,
nonNullInvalids, nonNullInvalids, _settings);
_weights = weightsResult.Value;
} |
Hey, sorry all, very busy with my day job. I still follow here but fixing this (and first figuring out what the root cause is) will take me a few days (at least) and I still haven't found the spare time. |
I'm not sure how to use the "TryCalculateWeight" code above. I generate a contracted database once and save it, and load it later using deserialization for performance reasons. Most of the issues occur when contracting the profile after loading the OSM data with restrictions (I guess this is what you call "turn based routing"), but there are a few issues that occur without restrictions as well as shown bellow. So there are issues as the ones bellow as well as the ones at the top of this issue related to contracted databases. I don't think there is a workaround for all of these issues as I have tried for a while now without any luck. |
Is there any progress on this issue? |
Is there any feedback or progress for a solution for this issue? |
I have two routes in Norway, same coordinates and "car.classifications" profile. The first is calculated with a router database with a contracted profile and the second is calculated with a router database without a contracted profile.
Both routes should be identical but they are not, and the route with the contracted profile has some strange choices. The non-contracted route is similar to what Google maps shows, but the contracted route is very different.
I'm using Itinero 1.5. I've also tried the latest pre-release with the same result.
Start position: 68 51 40.86N 18 20 54.30E
End position: 69 23 28.09N 20 16 02.13E
Non-contracted route (correct route):
Contracted route (incorrect route):
I want to have a contracted route that looks like the non-contracted image. Both routes should also be identical regardless of contracted and non-contracted profiles.
Any help would be much appreciated!
The text was updated successfully, but these errors were encountered: