Skip to content

[convert] Ensure winding order of polygon linear rings#28

Merged
mickmis merged 1 commit intomainfrom
8/ensurewindingorder
Mar 16, 2026
Merged

[convert] Ensure winding order of polygon linear rings#28
mickmis merged 1 commit intomainfrom
8/ensurewindingorder

Conversation

@mickmis
Copy link
Copy Markdown
Contributor

@mickmis mickmis commented Mar 12, 2026

Fix focagis/geoawareness-cis#8

Issue: linear rings of some polygons in the original ed269 do not respect the right-hand rule as specified by https://datatracker.ietf.org/doc/rfc7946/ section 3.1.6.

With the changes in this PR we ensure that the winding order do respect this rule.
We do so by using the Shoelace formula to determine whether the coordinates are specified clockwise or counter-clockwise, and reverse them if that is necessary.

The output of the converter for the FOCA files generated locally may be found in this gist. Checking manually e.g. the 'GE32' airspace seems to yield correct result.

@mickmis mickmis force-pushed the 8/ensurewindingorder branch from 365cb49 to a18b8a9 Compare March 12, 2026 15:52
Comment thread geospatial-utils/convert.py Outdated
@mickmis mickmis force-pushed the 8/ensurewindingorder branch from a18b8a9 to 86f74b9 Compare March 16, 2026 12:38
@mickmis mickmis merged commit d6913da into main Mar 16, 2026
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

Successfully merging this pull request may close these issues.

Geozone invalid geometries

2 participants