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

snapgeometries only snaps to vertices, not segments #50121

Closed
2 tasks done
Martin-BKT opened this issue Sep 6, 2022 · 13 comments
Closed
2 tasks done

snapgeometries only snaps to vertices, not segments #50121

Martin-BKT opened this issue Sep 6, 2022 · 13 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms Regression Something which used to work, but doesn't anymore

Comments

@Martin-BKT
Copy link

What is the bug or the crash?

When snapping a point layer to a line layer, QGIS 3.16 snapped the points to the closest segment when using parameter 1, as seen in the example (yellow line layer as reference layer, red point layer, green result layer)
Behaviour QGIS 3 16

In QGIS 3.26, the same algorithm with the same parameter and inputs no longer snaps to segments, but only to vertices:
Behaviour QGIS 3 26

Steps to reproduce the issue

Create a point and a line layer. use snapgeometries to snap points to the lines using parameter 1.

Versions

QGIS 3.16.16: OK
QGIS 3.26.2: Not OK.

Supported QGIS version

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

New profile

  • I tried with a new QGIS profile

Additional context

No response

@Martin-BKT Martin-BKT added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Sep 6, 2022
@nyalldawson
Copy link
Collaborator

Create a point and a line layer. use snapgeometries to snap points to the lines using parameter 1.

Can you clarify what you mean by "using parameter 1"?

@nyalldawson nyalldawson added the Feedback Waiting on the submitter for answers label Sep 6, 2022
@Martin-BKT
Copy link
Author

Martin-BKT commented Sep 7, 2022 via email

@roya0045
Copy link
Contributor

roya0045 commented Sep 7, 2022

@Martin-BKT
Copy link
Author

Pretty sure this is a user error and not a QGIS one, did you check https://docs.qgis.org/3.22/en/docs/user_manual/working_with_vector/editing_geometry_attributes.html#snapping-and-digitizing-options ?

The issue is not about snapping during edit, but when using snapgeometries in processing mode. Just open QGIS 3.16 and QGIS 3.26 with an initial user profile, create the 2 layers and use snapgeometries processing, and I would be surprised if you would get identical results.

@roya0045
Copy link
Contributor

roya0045 commented Sep 7, 2022

The issue is not about snapping during edit, but when using snapgeometries in processing mode. Just open QGIS 3.16 and QGIS 3.26 with an initial user profile, create the 2 layers and use snapgeometries processing, and I would be surprised if you would get identical results.

Ah right, it seems the 'closest' point' is now the closest vertex and not closest point on surface. And that's delegated to the QgsGeometrySnapper.

@github-actions
Copy link

The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale".
If you would like to continue with this issue, please provide any missing information or answer any open questions. If you could resolve the issue yourself meanwhile, please leave a note for future readers with the same problem and close the issue.
In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this issue.
If there is no further activity on this issue, it will be closed in a week.

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Sep 22, 2022
@Martin-BKT
Copy link
Author

Ah right, it seems the 'closest' point' is now the closest vertex and not closest point on surface. And that's delegated to the QgsGeometrySnapper.

Yes, that's the issue. Unfortunately, the function is quite important for us, so we cannot update to the newest version until the issue is resolved.

@github-actions github-actions bot removed the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Sep 22, 2022
@roya0045
Copy link
Contributor

Yes, that's the issue. Unfortunately, the function is quite important for us, so we cannot update to the newest version until the issue is resolved.

Your options are to keep using your current version. Hope someone wants to fix the bug eventually, or try to get it fixed (by submitting a fixing or funding a dev to fix it for you.)

@github-actions
Copy link

github-actions bot commented Oct 7, 2022

The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale".
If you would like to continue with this issue, please provide any missing information or answer any open questions. If you could resolve the issue yourself meanwhile, please leave a note for future readers with the same problem and close the issue.
In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this issue.
If there is no further activity on this issue, it will be closed in a week.

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Oct 7, 2022
@github-actions
Copy link

github-actions bot commented Nov 5, 2022

While we hate to see this happen, this issue has been automatically closed because it has not had any activity in the last 42 days despite being marked as feedback. If this issue should be reconsidered, please follow the guidelines in the previous comment and reopen this issue.
Or, if you have any further questions, there are also further support channels that can help you.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 5, 2022
@untsvn
Copy link

untsvn commented Nov 25, 2023

Sorry I'm new to logging issues like this - is it possible to reopen this as an issue or is the etiquette to open a new issue?

Have just encountered this issue in v3.22 so tried an upgrade to v3.24. Appears the "Prefer closest point" options are not working and is falling back to "Prefer aligning nodes"

See below screen shot for what I expect snap to nearest point to do with a 3m tolerance. I would expect the input vertices to snap to the closest point on the segment (indicated by arrows) and add vertices to that line depending on which behaviour was selected.

processing.run("native:snapgeometries", {'INPUT':'S:/OneDrive/Desktop/temp.gpkg|layername=ref_1_input','REFERENCE_LAYER':'S:/OneDrive/Desktop/temp.gpkg|layername=ref_2a','TOLERANCE':3,'BEHAVIOR':1,'OUTPUT':'TEMPORARY_OUTPUT'})

image

GPKG with embedded QGIS project attached whcih demonstrates this exmaple.

qgis_snap_issue.zip

@github-actions github-actions bot removed the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Nov 25, 2023
@gacarrillor
Copy link
Member

This issue should still be open. Feedback was provided by the OP in due time.

Reopening, since I just confirmed the issue on QGIS master rev 51d8e5d7982.

@gacarrillor gacarrillor reopened this Nov 28, 2023
@gacarrillor gacarrillor added Processing Relating to QGIS Processing framework or individual Processing algorithms Regression Something which used to work, but doesn't anymore and removed Feedback Waiting on the submitter for answers labels Nov 28, 2023
@uclaros
Copy link
Contributor

uclaros commented Jul 4, 2024

Fixed in #56426

@uclaros uclaros closed this as completed Jul 4, 2024
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! Processing Relating to QGIS Processing framework or individual Processing algorithms Regression Something which used to work, but doesn't anymore
Projects
None yet
Development

No branches or pull requests

6 participants