-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Turn penalties are being used when route starts at an intersection, not just before it #2287
Description
In writing a cucumber test for a node map
| a | b | c |
| d | | e |
| f | g | h |
with ways
ab
ad
bc
ce
df
eh
fg
gh
where all ways are highway=primary, and equidistant, I discovered that routes ac, ch, af, fh were returning different speeds, where I would have expected them to all return the same speed.
This bug also manifests itself in the following node map:
| | i | | j | |
| k | a | b | c | l |
| | d | | e | |
| m | f | g | h | n |
| | o | | p | |
(with the same ways, in addition to ai, ak, fm, fo, hn, hp, cj, cl, so that all four intersections were full four-way intersections) — in this case again ac, ch, hf, fa all return 59 km/h, wherease ca, hc, fh, af return 57 km/h.
This log shows numbers logged out of the edge_based_graph_factory for the first case. (The first two way names are name_table.GetNameForID(edge_data1.name_id) and name_table.GetNameForID(edge_data2.name_id). The turn angle is apparently being calculated from a possible preceding turn, despite the fact that there is 0 distance traveled on the preceding way — no turn is made as the route starts at an intersection, but a turn penalty is being factored into the first instruction nonetheless.
Bit of an edge case, but 🐛 regardless… : ] @MoKob