Repository navigation
Correct too small weightings for CH - #1032
Conversation
|
Hmmh, I do not know if this is the best solution. Detecting it via weighting.getMinWeight would be preferable as then we can throw this at start already. Will have to think about it. |
Yes makes sense as well. The problem with getMinWeight is that it depends on the distance of the edge. So we might be able to generate very small weight for edges that are very short (e.g. 1m long). The current FastestWeighting would return |
|
Any updates on this PR? |
|
What if we throw an exception instead of just silently logging it? |
Ok sure, we can do this. Should I update the PR? |
|
Ok, I updated this PR to throw an exception. |
|
I get a problem now for world wide coverage (motorcycle). There is a shortcut with weight==0 ... maybe this is a bug in the preparation code as the start and end seems to be identical |
|
Good thing is: this is locally reproducable with just a map extract |
|
Ah, the problem is that at this node is a very tiny circle added and all nodes have the exact same coordinate, see here where I have slightly moved the nodes to show the problem: Fixed this in the data: http://www.openstreetmap.org/changeset/50833637 |
|
Normally we can handle edges with zero distance, but we obviously cannot handle a ring structure condensed into a single coordinate (which would lead to shortcuts with weight==0) |
|
Wow, thanks for the additional information and the nice improvement! |
|
This happens a bit too often so for now the warning, then fixing all the problems (if not too many ;)) and maybe enabling the exception again |

As discussed in #1013, setting too small weights for CH leads to weights of 0. This can lead to very weird results. Therefore, I introduced a MIN_WEIGHT, in addition to the MAX_WEIGHT. If a weight is smaller than the min weight, the weight is corrected to the min weight. In addition I added a warning message so that developers can correct their weightings more easily.