Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to sort coordinates CW or CCW? #54

Open
rurounijones opened this issue Jan 18, 2022 · 0 comments
Open

Is there a way to sort coordinates CW or CCW? #54

rurounijones opened this issue Jan 18, 2022 · 0 comments

Comments

@rurounijones
Copy link

First off, I love this library. Lightweight and has everything I have needed so far. Great stuff!

I am in a situation where I have a collection of Coordinate objects which should be able to form a the shell of a polygon. I want to convert them to a Polygon object after verifying this fact.

The only snag is that these Coordinate objects are not in any sort of sorted order (e.g. Anti-Clockwise positioning) which means not following the advice from the wiki and doing things like putting them into a CoordinateSequence and calling IsClosed will not work.

Is there anything built-in to the Geo library that will take a collection of Coordinate objects and sort them CW or CCW so that things like IsClosed will work? I have had a peruse of the code and didn't see anything but I might have missed it.

If not then I think I have a way to do it but wanted to check if there was anything built-in first to avoid re-inventing the wheel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant