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
add test for add part to geometry less features on single geometry type layers #57261
base: release-3_34
Are you sure you want to change the base?
Conversation
…qgis/QGIS/commit/e2e8a1285022478a257c61e92f130b7ad715a591\nCaptured polygon must be converted to straight line if it's not a curve.
Co-authored-by: Nyall Dawson <nyall.dawson@gmail.com>
Hi @3nids, It seems that the problem comes from the step where the geometryless feature is created. It is created with an incorrect geometry type. I found that when debugging at this level. Below are some information on where I investigated, and misbehavior I detected. Scenario 1: Line Curve layer - add a part with the segment digitizing toolWhen the add-part map tool tries to add the geometry, the empty geometry is of type We fall here in the code and then the Scenario 2: Line Curve layer - add a part with the curve digitizing toolStill same type for the empty feature ( But with the curve digitizing tool the drawn part --> IMO this behavior, which results in a feature being added, is still wrong, because we are in a curve layer, which supports curves, and the good behavior should be to have a curve, not a segmentized linestring. Scenario 3: Polygon Curve layer - add a part with the curve digitizing toolThe empty geometry is of type Scenario 4: Polygon Curve layer - add a part with the segment digitizing toolThe empty geometry is of type --> IMO this behavior is what we want. My conclusionI think that one must look into why the geometryless feature is added with the wrong geometry type according to the layer, and everything should fall into place. Don't hesitate to ask if something is not clear 😉 |
Some more investigations lead me to this point https://github.com/qgis/QGIS/blob/master/src/core/vector/qgsvectorlayereditutils.cpp#L295 calling https://github.com/qgis/QGIS/blob/master/src/core/geometry/qgsgeometry.cpp#L980 where it is assumed that an empty geometry on which we want to add a part can't be curved. The logic must be changed. |
fixes #57255
cherry-picked from #55371 and #55810
I'm a bit lost in here, would be great to have your eyes @lbartoletti