In my app I am trying to route a simple trip that looks like A (start) → B → C (finish). However when moving map markers (pins) on the screen it is impossible to set it precisely because of the screen resolution etc. So if I put a pin B somewhere, for this example let’s say it is on a highway, I acutally get a coordinates that are somewhere around, maybye even hundred meters off. This makes a mess in the routing: if it is off the highway, the routing algorithm wants to get off the highway, pass some local road (where the point B actually is) and then get back to the highway on the nearest entry point.
So the problem is NOT that the points are not matched to the road network. They are mached to roads, but to wrong ones, to minor, small roads - in an urban area there are some roads everywhere so mathing to a paved road per se is not a problem. See here, where a viapoint 8 is just a bit off the highway and it wants to exit the highway and get back a moment later:
Technically, i want to correct B to some alternative B’, that would provide me the shortest and most smooth (with least turns) path from A to C. Or maybe just snapping to a bigger road would be enough.
Is there some sort of API parameter to achieve this?
All I was able to come up with is to try various points around B and pick the shortest result. This is definitely not the optimal solution
Can you be please more specific how should I procede? I have updated the question. Being not snapped to the road network is not a problem. Problem is that the points are snapped to roads, but not to the intended ones.
The Map Matching API requires points as input like the Routing API but it handles them like candidates (“GPS measurements”) that can be rejected to return a “more likely” (cost-reduced) route. The problem for your use case might be that a too large distance between points might be interpreted as an interrupted sequence leading to an error.