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

[OGC] Polygon: fix rings order (Request in QGIS) #8658

Open
1 of 2 tasks
qgis-bot opened this issue Nov 25, 2023 · 3 comments · May be fixed by #9523
Open
1 of 2 tasks

[OGC] Polygon: fix rings order (Request in QGIS) #8658

qgis-bot opened this issue Nov 25, 2023 · 3 comments · May be fixed by #9523
Labels
3.36 QGIS 3.36 new features Editing
Milestone

Comments

@qgis-bot
Copy link
Collaborator

Request for documentation

From pull request qgis/QGIS#55306
Author: @lbartoletti
QGIS version: 3.36

[OGC] Polygon: fix rings order

PR Description:

Description

I'm reaching out regarding an important initiative aimed at rectifying an anomaly observed in the digitization process within QGIS. Specifically, the adherence to OGC standards, upon which QGIS relies, dictates a distinct orientation requirement for polygon rings.

As per the OGC norm, the exterior boundary LinearRing must define the "top" of the surface, following a counterclockwise traversal along the boundary. Conversely, interior LinearRings should exhibit an opposite orientation, appearing clockwise when viewed from the "top."

Presently, there's a lack of verification within QGIS to ensure adherence to this prescribed behavior. To address this issue, I'll be initiating a series of PR; focusing only on the digitization process here. The primary goal is to align the behavior more closely with the established standards.

Nevertheless, I intend to maintain flexibility in the codebase, allowing for the preservation of the previous behavior programmatically. This approach aims to avoid directly enforcing orientation within the *Polygon classes. So, classes still accept "unordered" rings.

Before:

before-converted.mp4

After:

after-converted.mp4

PS: The motivation behind this is that certain tools perform stricter checks than the ones we currently conduct or those performed with GEOS.
PS2: I'm aware that ESRI Shapefile is CW unlike OGC, but should be a provider role to check this part?

TODO:

  • fix tests
  • add test

Commits tagged with [need-docs] or [FEATURE]

@github-actions github-actions bot added the 3.36 QGIS 3.36 new features label Nov 25, 2023
@github-actions github-actions bot added this to the QGIS 3.40 milestone Nov 25, 2023
@lbartoletti
Copy link
Member

The "after" video is not good, since we change slighty the behaviour.

@DelazJ
Copy link
Collaborator

DelazJ commented Nov 28, 2023

since we change slighty the behaviour.

Which if I understood is "that if the exterior ring is in one direction, all interior rings are in the opposite direction, and the parts follow the direction of the exterior ring"? Exterior rings of different features do not necessarily follow the same direction, right?
Now, for the user manual, why would someone need to know this? Changelog info? And if docs, where would this land for you?

@DelazJ DelazJ added the Editing label Nov 28, 2023
@lbartoletti
Copy link
Member

Which if I understood is "that if the exterior ring is in one direction, all interior rings are in the opposite direction, and the parts follow the direction of the exterior ring"?

Exact

Exterior rings of different features do not necessarily follow the same direction, right?

Exact

Now, for the user manual, why would someone need to know this? Changelog info?

Because, if you draw with an arrow style, you'll see the orientation of your ring potentially inverted and can cause interrogation.
These kinds of rules are not known by many geomaticians and an explanation could be written, thought.

And if docs, where would this land for you?

In https://docs.qgis.org/3.28/fr/docs/user_manual/working_with_vector/editing_geometry_attributes.html#add-part and https://docs.qgis.org/3.28/fr/docs/user_manual/working_with_vector/editing_geometry_attributes.html#add-ring

DelazJ added a commit to DelazJ/QGIS-Documentation that referenced this issue Jan 4, 2025
in polygon part and ring geometries
fixes qgis#8658
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.36 QGIS 3.36 new features Editing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants