osrm-backend icon indicating copy to clipboard operation
osrm-backend copied to clipboard

Penalize uturn selection in map matching model

Open karenzshea opened this issue 7 years ago • 3 comments

Issue

Currently, candidate selection in map matching allows uturn insertion based on turn angles from one trace coordinate to the next, though the Viterbi model acting on the candidates does not properly penalize uturns.

The issue manifests in ambiguous map matching cases like at a four way 90-degree intersection where the model chooses to snap a trace coordinate to the segment that would require a uturn maneuver to reach the next trace coordinate, rather than the more optimal segment that would require a non-uturn maneuver to reach the next trace coordinate. This is caused by the model not taking a uturn penalty into consideration when choosing between two forward and backward segments.

We want to modify the Viterbi model to calculate backwards nodes transition probabilities with uturn penalties.

Tasklist

  • [x] Remove uturn detection logic in candidate selection
  • [ ] Sort phantom nodes by distance before splitting
  • [ ] Always split Phantom Nodes in candidate selection
  • [ ] In Viterbi model, apply uturn penalty constant to transition probabilities

Hotfix

In the short term, we can fix some portion of the map matching responses that suffer from missing uturn penalization by adjusting the turn angle range in uturn detection to be stricter.

The long term solution that properly handles all situations is spelled out above.

cc @TheMarex @oxidase

karenzshea avatar Feb 27 '18 12:02 karenzshea