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

Some tools incorretly handle curve geometry and segmentize it, even for layers that supports curved geometry. #54386

Closed
2 tasks done
Kamzarr opened this issue Aug 28, 2023 · 12 comments
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

Comments

@Kamzarr
Copy link

Kamzarr commented Aug 28, 2023

What is the bug or the crash?

It seems that curves are not correctly handled in some tools from Advanced Digitizing Toolbar. For example:

Issue 1: When layer have gometry type of CurvePolygon but feature have simple polygon geometry, then adding ring with curve automatically segmentize this curve into lines. For feature that have geometry with curve this adding curved ring works correctly.

Issue 2: Using "Reshape Feature" and "Offet Curve" also segmentize existing geometry into lines but other tools seems to work ok (vertex tool, move, rotate, scale, trim/extend).

Steps to reproduce the issue

Issue 1:

  1. Create temporary or gpkg layer with geometry type CurvePolygon or MultiSurface
  2. Add two polygons: First (A) without any curve, second (B) with curve

image

  1. Using "Add Ring" tool, add rings containing curve to both features
  2. For feature A ring was segmentized, for feature B ring was not semgmentized because it had curve originally

image

Issue 2:

  1. Create temporary or gpkg layer with any of curve geometry (CompoundCurve, MultiCurve, CurvePolygon or MultiSurface)
  2. Add feature containing curve

image

  1. Edit feature using "Reshape Feature" tool
  2. Curve in feature geometry is automatically segmentized

Edit 1:
image

Edit 2:
image

Using "OffsetCurve" also segmentize features

Versions

checked on 3.24.2 and 3.32.1

Supported QGIS version

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

New profile

Additional context

No response

@Kamzarr Kamzarr added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Aug 28, 2023
@agiudiceandrea
Copy link
Contributor

Hi @Kamzarr, thanks for the detailed report.
@Djedouas, doesn't your recent PR #53895 also fix this issue?

@gisuser0
Copy link

Same issue with other tools.
Create a curvepolygon layer (geopackage, postgis or temporary layer) and draw a polygon with at least one curve.
Open the "Processing Toolbox" and run the "Fix geometries" (it doesn't matter if the geometry is correct or not).
In the resulting polygon the curve is converted into segments.
Thx

@Kamzarr
Copy link
Author

Kamzarr commented Aug 31, 2023

I found another issue, this time in Check Validity tool. For geometries with curve type, checking validity using QGIS method, does not work correctly.
For CurvePolygon and CompoundCurve:

  1. Create layer with geometry CurvePolygon or CompoundCurve
  2. On this layer draw 2 invalid features (self intesecting): first without curve segment, second with curve
    image
  3. Perform Check Validity with QGIS method
  4. For first feature error was found, but in second error wasn't foud
    image

For multi curve geometries:

  1. Create MultiCurve or MultiSurface layer
  2. Draw any invalid features you like (with self intesection)
    I have example with two feautres: one with 3 parts (indluding one part with curve), second with one part and without curves:
    image
  3. Perform Check Validity with QGIS method
  4. None errors were found
    image

It looks like it doesn't work for any geometry of curve type.
In case of signle geometries output geometry depends on what you draw, my first example of drawing feature on CompoundCurve layer:
image
so checking validity will work for this geometries without curves

but in multi geometry layers it doesn't matter what you draw, you always will get curve geometry as output (my example):
image
so checking validity in multi curve geometry layers never work

@agiudiceandrea agiudiceandrea added the Digitizing Related to feature digitizing map tools or functionality label Sep 1, 2023
@Djedouas
Copy link
Member

Djedouas commented Sep 4, 2023

@agiudiceandrea @Kamzarr

Issue 1: When layer have gometry type of CurvePolygon but feature have simple polygon geometry, then adding ring with curve automatically segmentize this curve into lines. For feature that have geometry with curve this adding curved ring works correctly.

This issue is fixed with #53895

Ping @lbartoletti for discussion, to maybe see if some behaviors described here with tools and processings are like this on purpose or not...

@alexbruy
Copy link
Contributor

Fixed in the latest master (ae45e66). Please reopen if necessary.

@AlisterH
Copy link
Contributor

AlisterH commented Jan 9, 2024

I found another issue, this time in Check Validity tool. For geometries with curve type, checking validity using QGIS method, does not work correctly. For CurvePolygon and CompoundCurve:

  1. Create layer with geometry CurvePolygon or CompoundCurve
  2. On this layer draw 2 invalid features (self intesecting): first without curve segment, second with curve
    image
  3. Perform Check Validity with QGIS method
  4. For first feature error was found, but in second error wasn't foud
    image

Do we need to file another ticket for this problem? It is still present in 3.34.1 (sorry, can't test 3.34.2 right now).

@bencahill
Copy link

Issue 2:

  1. Create temporary or gpkg layer with any of curve geometry (CompoundCurve, MultiCurve, CurvePolygon or MultiSurface)
  2. Add feature containing curve
  3. Edit feature using "Reshape Feature" tool
  4. Curve in feature geometry is automatically segmentized

It doesn't look like Issue 2 was ever solved (specifically, the Reshape Feature bug). I can reproduce it on 3.40.2.

Can this issue be reopened, or does another ticket need to be filed? I can reproduce with the exact steps in the first post.

Thank you.

@agiudiceandrea
Copy link
Contributor

I think it would be more effective to open a new issue.

@agiudiceandrea
Copy link
Contributor

@Djedouas @AlisterH @Kamzarr see new issue report about the "Issue 2", not yet fixed, at #60065.

@m-kuhn
Copy link
Member

m-kuhn commented Jan 7, 2025

This is a problem in geos which requires a larger undertaking to be fixed. If someone wants to support this initiative, please get in touch.

@m-kuhn
Copy link
Member

m-kuhn commented Jan 7, 2025

Fixed in the latest master (ae45e66). Please reopen if necessary.

Looks unrelated

@m-kuhn m-kuhn reopened this Jan 7, 2025
@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented Jan 7, 2025

@m-kuhn this issue report contains actually 2 reported issue and a 3rd one in a comment. While the 1st issue has been allegedly fixed, the 2nd (and probably also the 3rd) one still occurs.

@m-kuhn m-kuhn closed this as completed Jan 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! Digitizing Related to feature digitizing map tools or functionality
Projects
None yet
Development

No branches or pull requests

8 participants