I'm trying to add a snap-to-road function in my all custom made GPS software. There's a few thousand of roads with hundreds of thousands of nodes (lat-lon points). I have read all those snap to road question in SO with "closest point on a line" as a good solution. However, what I am doing is to snap to a nearest road with the same direction as the car is driving. I'm so confused with how to achieve it. A simple procedure would help me a lot. (Please also note hundreds of thousands or nodes in concern as performance).
EDIT: Guys? c'mon, gimmie a clue.