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.
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 aPolygon
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 aCoordinateSequence
and callingIsClosed
will not work.Is there anything built-in to the
Geo
library that will take a collection ofCoordinate
objects and sort them CW or CCW so that things likeIsClosed
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.