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

Trouble Adding Rings to Polygons in Vector Layers: Works Inconsistently #59053

Closed
2 tasks done
Ipickedausername opened this issue Oct 11, 2024 · 3 comments · Fixed by #59066
Closed
2 tasks done

Trouble Adding Rings to Polygons in Vector Layers: Works Inconsistently #59053

Ipickedausername opened this issue Oct 11, 2024 · 3 comments · Fixed by #59066
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Digitizing Related to feature digitizing map tools or functionality Regression Something which used to work, but doesn't anymore

Comments

@Ipickedausername
Copy link

Ipickedausername commented Oct 11, 2024

What is the bug or the crash?

Hello,

I am working with a SpatiaLite layer in CRS 2154 (the same as the project's CRS) with a Multi-polygon geometry type.
When I attempt to add a ring inside a polygon, it works inconsistently.

Most of the time, if the process fails, creating another ring with fewer vertices and/or a smaller ring, will resolve the issue about 90% of the time.

I have tested this on other SpatiaLite layers with Polygon geometry, on Shapefile layers, and in different projects, but the issue persists.

Steps to reproduce the issue

The issue is easy to reproduce; we simply need to add a ring with many vertices.
However, it seems very difficult to identify a pattern (number of vertices, shape of the ring, size of the ring).

Here are two pictures to show that the ring creation is possible within the same polygon, despite the error message.
erreur
paserreur

And, here is a test project where I can reproduce this issue.
Test_project.zip

Versions

<style type="text/css"> p, li { white-space: pre-wrap; } </style>
Version de QGIS 3.38.3-Grenoble Révision du code 37f9e6e
Version de Qt 5.15.13
Version de Python 3.12.6
Version de GDAL/OGR 3.9.2
Version de Proj 9.4.0
Version de la base de données du registre EPSG v11.004 (2024-02-24)
Version de GEOS 3.12.2-CAPI-1.18.2
Version de SQLite 3.45.1
Version de PDAL 2.6.3
Version du client PostgreSQL 16.2
Version de SpatiaLite 5.1.0
Version de QWT 6.2.0
Version de QScintilla2 2.14.1
Version de l'OS Windows 10 Version 2009
       
Extensions Python actives
GroupStats 2.2.7
mapswipetool_plugin 1.3
networks 2.7.19
OpenTopography-DEM-Downloader 2.0
qfieldsync v4.9.1
quick_map_services 0.19.34
db_manager 0.1.20
grassprovider 2.12.99
processing 2.12.99
Version de QGIS 3.38.3-Grenoble Révision du code [37f9e6e](https://github.com/qgis/QGIS/commit/37f9e6efee) Version de Qt 5.15.13 Version de Python 3.12.6 Version de GDAL/OGR 3.9.2 Version de Proj 9.4.0 Version de la base de données du registre EPSG v11.004 (2024-02-24) Version de GEOS 3.12.2-CAPI-1.18.2 Version de SQLite 3.45.1 Version de PDAL 2.6.3 Version du client PostgreSQL 16.2 Version de SpatiaLite 5.1.0 Version de QWT 6.2.0 Version de QScintilla2 2.14.1 Version de l'OS Windows 10 Version 2009

Extensions Python actives
GroupStats
2.2.7
mapswipetool_plugin
1.3
networks
2.7.19
OpenTopography-DEM-Downloader
2.0
qfieldsync
v4.9.1
quick_map_services
0.19.34
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

@Ipickedausername Ipickedausername added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Oct 11, 2024
@Ipickedausername Ipickedausername changed the title Weird behavior Trouble Adding Rings to Polygons in SpatiaLite Layers: Works Inconsistently Oct 12, 2024
@Ipickedausername Ipickedausername changed the title Trouble Adding Rings to Polygons in SpatiaLite Layers: Works Inconsistently Trouble Adding Rings to Polygons in Vector Layers: Works Inconsistently Oct 12, 2024
@agiudiceandrea
Copy link
Contributor

@Ipickedausername, thanks for reporting.

Are you sure the layer has the right CRS assigned? It looks like the features are located in the middle of the Atlantic Ocean and have a maximum dimension of few millimetres.

Does the issue also occur if you select the polygon feature before trying to add a ring in it?

The provided folder contains 4 layers and a project file and the provided project contains 3 layers. May you please describe which layer should be edited and how exactly in order to replicate the issue?

@agiudiceandrea agiudiceandrea added the Digitizing Related to feature digitizing map tools or functionality label Oct 12, 2024
@Ipickedausername
Copy link
Author

Ipickedausername commented Oct 12, 2024

Hello,

Yes, I simply created a project and specified the CRS before doing the tests. I didn't add a base map, so I didn't notice it was in the middle of the ocean.

I adjusted the location of the polygons, somewhere in France, where Lambert93 apply. I was able to reproduce this issue.

However, I wasn't able to reproduce the issue when the polygon is selected !
Same error if 2 polygons are selected and the ring is contained in one of them.

So, it seems that, if the polygon isn't selected, QGIS cannot always detect where the ring is located?

The layer I used to do these tests is called Layer1.

@agiudiceandrea agiudiceandrea added the Regression Something which used to work, but doesn't anymore label Oct 13, 2024
@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented Oct 13, 2024

It looks like the issue didn't occur using QGIS <= 3.26 while it does occur using QGIS >= 3.28. The regression may be related to #50447.
I'll propose a fix.

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! Digitizing Related to feature digitizing map tools or functionality Regression Something which used to work, but doesn't anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants