-
Notifications
You must be signed in to change notification settings - Fork 17
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
Update order of vertexes, and add closing vertex for Oracle. #142
base: main
Are you sure you want to change the base?
Conversation
I've included a namespace fix for the table reader as well, but it may not be the right way to fix it. |
processOrdinateParameters(); | ||
} | ||
|
||
private void ensureCounterClockwise() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume the algorithm here is for a polygon on a flat plane, so is approximate. I don't know what "edgeSum" is but this looks less complex than the code in caom2 which does this by computing the area via triangulation.
Is this calculation going to work in edge cases:
- near or includes the pole
- overlaps the meridian (longitude=0) so some vertices have longitude near 360 and others near 0
- is is larger than half the sphere
It's probably OK to not support #3 (for now), but it should be detected and rejected. 1 and 2 need to be taken into account somehow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct. The sum of the edges indicates a clockwise direction if it's a positive number, and counter-clockwise if it's negative, and assumes a flat plane. I hadn't realized it needed to be more complex than that, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the GrahamScan
in CAOM-2 a place to start learning about how to handle those three cases? Is this the "winding" method?
Ensure Polygon vertices are in counter-clockwise order.
Ensure Polygons are closed before sending to Oracle.