Open Archdoog opened 1 week ago
Thanks for capturing this!
Trim the snap location candidates to the next n coordinates
I initially thought in should be ±n, but on second thought, I think you're right (or we should limit the backward search to a smaller number). I guess the use case for snapping is primarily with cars, which can't easily reverse like a pedestrian, cyclist, etc., so this is probably a reasonable way to approach it.
After a second coffee, I think we need to consider the edge cases around a significant delay in GPS updates. The easiest example is a tunnel, where you may be skipping dozens or even a hundred points at a time (without forward progress simulation; separate topic :D). So there needs to be either selective activation or some fallback behavior.
Two ideas:
I think this is what everyone ends up with long-term 😅 We have a path to doing this with valhalla-mobile
, and users my of course bring their own solution. I think the thing to figure out in Ferrostar (eventually) is what a trait would look like for that, and integrating it into the core. Just riffing for a moment, it might be something like LocationSnapper
(cue angry turtles :D), and we include an implementation that does what we do today + improvements we decide on. But it also offers a convenient hook point for map matching instead based on some window of previously seen locations.
Location snapping currently has issues when a route overlaps itself (e.g an offramp cloverleaf or out and back route). When this occurs, the snapped location can jump forward. Not sure if it causes an issue with the actual route progress, but since location pushes progress events, seems likely.
Ideas