2 Attachment(s)

Track points 2D. Split and generalize polylines.

Hi gurus.

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.

Attachment 31329

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.

Attachment 31331

Any help is appreciated; documents, ideas.... Thanks in advance.

Best regards!

Is clear the question?