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

Geometry checker accepts invalid polygon #60464

Open
1 of 2 tasks
jleedev opened this issue Feb 5, 2025 · 4 comments
Open
1 of 2 tasks

Geometry checker accepts invalid polygon #60464

jleedev opened this issue Feb 5, 2025 · 4 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!

Comments

@jleedev
Copy link

jleedev commented Feb 5, 2025

What is the bug or the crash?

"Check validity" with GEOS method correctly finds the error in this polygon. With QGIS method it does not.

Steps to reproduce the issue

thing.csv

 ¶ ogrinfo --version
GDAL 3.6.2, released 2023/01/02
 ¶ cat thing.csv
WKT,
"POLYGON((0 0,10 0,10 10,0 10,0 0),(5 8,4 7,5 6,6 7,5 8),(5 6,4 5,5 4,6 5,5 6),(6 5,7 4,8 5,7 6,6 5),(7 6,8 7,7 8,6 7,7 6))",
 ¶ ogrinfo -q thing.csv -dialect sqlite -sql 'select ST_IsValidReason(GEOMETRY) from thing'

Layer name: SELECT
OGRFeature(SELECT):0
  ST_IsValidReason(GEOMETRY) (String) = Interior is disconnected[6 5]

Versions

<style type="text/css"> p, li { white-space: pre-wrap; } </style>
QGIS version 3.34.15-Prizren QGIS code branch Release 3.34
Qt version 5.15.8
Python version 3.11.2
GDAL/OGR version 3.6.2
PROJ version 9.1.1
EPSG Registry database version v10.076 (2022-08-31)
GEOS version 3.11.1-CAPI-1.17.1
SQLite version 3.40.1
PostgreSQL client version 15.10 (Debian 15.10-0+deb12u1)
SpatiaLite version 5.0.1
QWT version 6.1.4
QScintilla2 version 2.13.3
OS version Debian GNU/Linux 12 (bookworm)
       
Active Python plugins
MetaSearch 0.3.6
db_manager 0.1.20
grassprovider 2.12.99
processing 2.12.99
QGIS version 3.34.15-Prizren QGIS code branch [Release 3.34](https://github.com/qgis/QGIS/tree/release-3_34) Qt version 5.15.8 Python version 3.11.2 GDAL/OGR version 3.6.2 PROJ version 9.1.1 EPSG Registry database version v10.076 (2022-08-31) GEOS version 3.11.1-CAPI-1.17.1 SQLite version 3.40.1 PostgreSQL client version 15.10 (Debian 15.10-0+deb12u1) SpatiaLite version 5.0.1 QWT version 6.1.4 QScintilla2 version 2.13.3 OS version Debian GNU/Linux 12 (bookworm)

Active Python plugins
MetaSearch
0.3.6
db_manager
0.1.20
grassprovider
2.12.99
processing
2.12.99

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

No response

@jleedev jleedev added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Feb 5, 2025
@elpaso
Copy link
Contributor

elpaso commented Feb 5, 2025

Cannot reproduce on current master.

Image

@agiudiceandrea
Copy link
Member

@elpaso, you need to set the METHOD: 1 (QGIS).

@elpaso elpaso self-assigned this Feb 6, 2025
@jleedev
Copy link
Author

jleedev commented Feb 6, 2025

Reproduced on 3.41.0 master for bookworm:

Image

@elpaso
Copy link
Contributor

elpaso commented Feb 7, 2025

Looking at the code of the QGIS implementation I think the check for disconnected rings was never implemented:
https://github.com/qgis/QGIS/blob/master/src/core/qgsgeometryvalidator.cpp#L211

I think this issue is probably more of a feature request than a bugfix, should we document the limitation of the QGIS method and recommend the more strict GEOS method?

@elpaso elpaso removed their assignment Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!
Projects
None yet
Development

No branches or pull requests

3 participants