You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My routing program has been running well, many thanks for a superb package.
However today I came across a crash. I am using .net Maui
Here is my code
public double ItineroDistance(PostcodePosition pp1, PostcodePosition pp2)
{
// calculate a route.
// snaps the given location to the nearest routable edge.
var start = router.Resolve(profile, (float) pp1.Latitude, (float) pp1.Longitude);
var end = router.Resolve(profile, (float) pp2.Latitude, (float) pp2.Longitude);
var route = router.Calculate(profile, start, end);
return route.TotalDistance; //(in meters)
}
pp1.Latitude was 53.033809 pp1.Longitude was -2.151793
pp2.Latitude was 52.807553 pp2.Longitude was -1.740858
The profile is "car"
I obtain these from UK Postcodes ST1 6SS and DE13 9RD https://api.postcodes.io/postcodes/
The exception
Itinero.Exceptions.ResolveFailedException: 'Could not resolve point at [52.807552, -1.740858]. Probably too far from closest road or outside of the loaded network.'
On OpenStreetMap (which I'm using)
On Google
What would be the best way to handle this? Use a try catch? Then what would I do in the catch? I could just do a CrowFlies calc (I have some code for that) I suppose. Or is it a bug?
Thanks for any suggestions, advice, help.
Gordon :)
The text was updated successfully, but these errors were encountered:
Doing a try catch meant that the exception could be ignored (ok handled). Any other thoughts. I suspect something about the farm track/lane is not being recognised?
My routing program has been running well, many thanks for a superb package.
However today I came across a crash. I am using .net Maui
Here is my code
pp1.Latitude was 53.033809 pp1.Longitude was -2.151793
pp2.Latitude was 52.807553 pp2.Longitude was -1.740858
The profile is "car"
I obtain these from UK Postcodes ST1 6SS and DE13 9RD
https://api.postcodes.io/postcodes/
The exception
Itinero.Exceptions.ResolveFailedException: 'Could not resolve point at [52.807552, -1.740858]. Probably too far from closest road or outside of the loaded network.'
On OpenStreetMap (which I'm using)
![image](https://user-images.githubusercontent.com/22768967/182599002-3a59b671-90a4-45e3-ac9d-66d186e358df.png)
On Google
![image](https://user-images.githubusercontent.com/22768967/182598391-ddd2044d-e022-43d8-a3b7-dddd2a4edac4.png)
What would be the best way to handle this? Use a try catch? Then what would I do in the catch? I could just do a CrowFlies calc (I have some code for that) I suppose. Or is it a bug?
Thanks for any suggestions, advice, help.
Gordon :)
The text was updated successfully, but these errors were encountered: