Track points 2D. Split and generalize polylines.
I'm working with track points. I need separate the original track in parts that are not duplicate. I'm looking for algorithm to solve examples like these:
Example 1: if target is A, the goal is A and A-B is the same way that B-A, we only have one track A-B.
Example 2: if we arrive to a roundabout and we use it only for change the direction we have two tacks: one to arrive the roundabout and two the roundabout.
Any help is appreciated; documents, ideas.... Thanks in advance.
Is clear the question?