We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 380144e commit 7d497d5Copy full SHA for 7d497d5
src/Itinero/Network/Enumerators/Edges/IEdgeEnumeratorExtensions.cs
@@ -38,7 +38,17 @@ public static double EdgeLength(this IEdgeEnumerator enumerator)
38
{
39
if (enumerator.Length != null) return enumerator.Length.Value / 100.0;
40
41
- return enumerator.GetCompleteShape().DistanceEstimateInMeter();
+ var length = enumerator.GetCompleteShape().DistanceEstimateInMeter();
42
+
43
+ // Workaround a problem where 2 nodes in OSM are so close together
44
+ // that after encoding/decoding their coordinates become same
45
+ // if we return cost 0, it indicates this is one way road
46
+ // hence routing doesn't go over it
47
+ if (length == 0)
48
+ {
49
+ length = 0.01; // 1 centimeter
50
+ }
51
+ return length;
52
}
53
54
/// <summary>
0 commit comments