Skip to content

Add a meaningful point when 'interior ring not in exterior ring' geometry error is found #62595

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

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

Conversation

gacarrillor
Copy link
Member

Currently, when running native:checkvalidity algorithm (with the QGIS validation mode) a NULL point is set for such error feature, making it hard to locate.

For the same error type, GEOS mode passes the start point of the interior ring.

This PR makes sure QGIS mode also passes the start point of the ring, if any.

…ing' geometry error is found (currently, a NULL geometry is passed)
@gacarrillor gacarrillor added Processing Relating to QGIS Processing framework or individual Processing algorithms Vectors Related to general vector layer handling (not specific data formats) labels Jul 15, 2025
@github-actions github-actions bot added this to the 3.46.0 milestone Jul 15, 2025
Copy link
Contributor

github-actions bot commented Jul 15, 2025

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit 032cfe0)

🍎 MacOS Qt6 builds

Download MacOS Qt6 builds of this PR for testing.
This installer is not signed, control+click > open the app to avoid the warning
(Built from commit 032cfe0)

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit 032cfe0)

@gacarrillor gacarrillor reopened this Jul 16, 2025
@nyalldawson
Copy link
Collaborator

Can you add a test please?

const QgsCurve *interiorRing = polygon->interiorRing( i );

if ( interiorRing->numPoints() == 0 )
emit errorFound( QgsGeometry::Error( msg ) );
Copy link
Contributor

Choose a reason for hiding this comment

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

This error will be misleading if interior ring has no points

Copy link
Member Author

Choose a reason for hiding this comment

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

True, and that's actually the current behavior.
Nevertheless, QGIS will also find a ring 1 with less than four points error in that case.

In this PR we're just making sure that IF there are points in the interior ring, we do return the starting one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Processing Relating to QGIS Processing framework or individual Processing algorithms Vectors Related to general vector layer handling (not specific data formats)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants