determine if 2 randomly rotated polylines are the same

This topic is 4024 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

I have a polyline composed of line segments which I have to search for a match against a DB of polylines. The catch is the all the polylines may be rotated arbitrarily. so I can't simply compare point by point. Does anybody have ideas on how to solve this? I'm searching for "rotation invariant searching" but it seems to complicated for what I am trying to do. I'm hoping somebody has a simpler solution.

Share on other sites
If I understand what you're doing right, I'd have all the polylines in your list rotated so that one arbitrary end of the polyline is oriented vertically or horizontally.

Then you line up your polyline to check the same way (an arbitrary end rotated to be vertical or horizontal (whichever suits you best). Then you can check pointwise. If there isn't a match, use the other end of your polyline to line up, and try again.

Hope I explained that well. The idea is just to orient some part of your lines so that they're all similar. This way you're eliminating the arbitrary rotations segments can have from the searching criteria.

1. 1
Rutin
21
2. 2
3. 3
JoeJ
18
4. 4
5. 5

• 13
• 38
• 23
• 13
• 13
• Forum Statistics

• Total Topics
631715
• Total Posts
3001868
×