Sign in to follow this  
yapposai

determine if 2 randomly rotated polylines are the same

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 this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this