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

Force polygons and multi-polygons to follow right-hand rule? #17

Open
mradamcox opened this issue Dec 3, 2024 · 2 comments
Open

Force polygons and multi-polygons to follow right-hand rule? #17

mradamcox opened this issue Dec 3, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@mradamcox
Copy link

Hello! This is a super helpful website, so thank you for making it. I have been creating some polygons with it (and pasting in externally created ones for quick visualization), and it works like a charm.

However, I noticed that if I draw a polygon in a clockwise order of points, this order is retained in the output WKT, even though the spec for WKT requires that exterior polygon coords of a polygon are ordered counter-clockwise, i.e. they must follow the right-hand rule. Likewise, a pasted in WKT that doesn't follow the right-hand rule can not be validated or corrected.

So this is just a suggestion that it would be very helpful to have something like a "force right-hand rule" checkbox that would correct any invalid coordinate order. Thank you!

@pieterprovoost pieterprovoost self-assigned this Dec 3, 2024
@pieterprovoost pieterprovoost added the bug Something isn't working label Dec 3, 2024
@mradamcox
Copy link
Author

Slightly different approach would be to not change any coordinates in the text box, but to apply this transformation when the user clicks Copy as > WKT, such that any "exported" WKT through that method does follow the rule.

@pieterprovoost
Copy link
Owner

As a first step I have implemented automated fixing of polygons created using the drawing tool. I'll look into a checkbox or button for validating pasted WKT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants