Turn restriction display/editing fails when two roads meet at both ends
Opened this issue · 1 comments
(This will be true if #1091 is merged.)
How to reproduce
- Locate a small crescent road which meets the same main road at each end, and there are no other intermediate intersections.
- Open this location in the LTN tool
- Attempt to add/edit turn restrictions at both ends of the road.
Expected results
The icons for the new/edited turn restrictions should show at the end of the road where it was edited.
Actual results
The icons for the new/edited turn restrictions will always show at the same end of the road, irrespective of which end of the road was clicked on during editing.
abstreet-bug-1108.mp4
See video:
- The first edit (western end of Queens Court) the turn restriction sign appears where expected
- The second edit (the eastern end of Queens Court) the turn restriction still appears at the western end, despite the edit occurring at the eastern end.
Notes:
-
The immediate cause is the arbitrary choice made here
Line 1079 in e018d33
-
The wider problem is that this is likely to be a limitation of the road.turn_restictions structure. This doesn't store information about which intersection the turn relates to. Presumably on the assumption that the intersection is unambiguous - which it is in the large majority of cases. See discussion here #1091 (comment)
-
Not tested yet but suspected => importing this scenario from OSM data would result in the same problem. It might be appropriate/helpful to build a test case around this.