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

Indicate vertices order orientation in polygon part and ring geometries #9523

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

DelazJ
Copy link
Collaborator

@DelazJ DelazJ commented Jan 4, 2025

fixes #8658
Also update an old fix me and describe "add ring" how-to

DelazJ added 2 commits January 4, 2025 21:25
in polygon part and ring geometries
fixes qgis#8658
and remove a fix me (refs qgis/QGIS#50447)
@DelazJ DelazJ added Editing backport release_3.40 On merge create a backported pull request to 3.40 labels Jan 4, 2025
@DelazJ
Copy link
Collaborator Author

DelazJ commented Jan 8, 2025

@lbartoletti May I request your review whether I summarized correctly the changes, please? Thanks.

.. note:: **Order of vertices in polygon parts**

Unlike the OGC standards, QGIS doesn't constrain vertices
of the exterior boundary of a polygon feature to be ordered counterclockwise.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exact. However, you can "fix" the case using processing

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main point I wanted to highlight in the note is the parts being oriented the same way. I thus added the "fix" tip in another paragraph.

A hole appears in the selected geometries.
#. If no geometry is selected when the ring is drawn,
then a hole is added to each of the polygons the ring is drawn over.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, you can add a note indicating that after AddRing, the vertices of the inner rings are oriented in the opposite direction to the exterior ring.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm... Isn't this covered in the note just below?

Thus, you can find both directions in a layer.
However, every parts of the same multipolygon feature
will have their outer vertices ordered following the same direction.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can however use the :ref:`qgisforcerhr` algorithm to constrain features of a layer
to have vertices of their outer boundaries ordered in the clockwise direction.

.. note:: **Order of vertices in polygon parts**

Unlike the OGC standards, QGIS doesn't constrain vertices
of the exterior boundary of a polygon feature to be ordered counterclockwise.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main point I wanted to highlight in the note is the parts being oriented the same way. I thus added the "fix" tip in another paragraph.

A hole appears in the selected geometries.
#. If no geometry is selected when the ring is drawn,
then a hole is added to each of the polygons the ring is drawn over.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm... Isn't this covered in the note just below?

of the exterior boundary of a polygon feature to be ordered counterclockwise.
Thus, you can find both directions in a layer.
However, every rings of the same (multi)polygon feature
will have their vertices ordered in the opposite direction to the outer boundary's.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can however use the :ref:`qgisforcerhr` algorithm to constrain features of a layer
to have vertices of their outer boundaries ordered in the clockwise direction,
and vertices of their interior rings ordered in the counter-clockwise direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release_3.40 On merge create a backported pull request to 3.40 Editing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[OGC] Polygon: fix rings order (Request in QGIS)
2 participants