- This is to make difference comparisons easier
- The only nodes that didn't have a `loc` were fake nodes we made for testing
- So this commit also fixes the `osmIntersection` code and tests.
partially adresses bugs in #4968:
* doesn't crash anymore in complex situations (short FROM ways where both ends connect to a TO way)
* adding a only-restriction at one end of a short FROM doesn't delete restrictions on the other end of the same FROM anymore
(closes#4951)
Previously it would only count if the connecting node was the first one.
I guess I was only thinking about oneways only the day I wrote that code.
(closes#4844)
The maxDistance was previously hardcoded to 30 meters.
Now we pass it in as a parameter when creating the intersection.
But we need to honor that same maxDistance later when walking the graph
to find turns from.
(I decided that the larger context of the intersection is important and
shouldn't be hidden from the user)
Also
- show detail slider only if the intersection is complex
- hide the restriction editor completely if there is no real intersection
(e.g. junction of `highway=path`)
This is the part of the algorithm where trivial sections get trimmed
from the vgraph. Removing a vertex from `vertexIds` means "stop checking
this one". But there were some situations where it could get removed
twice, so we now just verify that `vertexId` is actually in the array
before calling `splice`.