Bug report #17324

Geometries guided by advanced digitization tools snap inaccurately.

Added by Kyle Welsh about 3 years ago. Updated about 3 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Digitising
Affected QGIS version:2.18.13 Regression?:No
Operating System:Windows 7 Professional, Service Pack 1, 64-bit Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:25222

Description

Caveats:
  • Though the attachments in this defect are captured from QGIS 2.18.0, it has been confirmed as still being valid on 2.18.13, and was seen in versions as early as 2.12.
  • Though the attachment and reproduction steps refer to line layers, this is also valid in polygon layers.
  • Though the attachment shows the defect occurring over two separate layers, this is simply as a visual aid; the defect can also be reproduced within a single layer.

When attempting to snap a "guided" line - that is to say, one which is being guided by the advanced digitizing tools - to a currently existing geometry, the line can be seen to jump off of its intended path.

Judging by the fact that a line drawn on the other side of the incorrectly snapped point will snap to the same incorrect point, it is assumed that this is due to a precision / rounding error within the snapping tool.

There is a workaround available through "overdrawing" the line, which I believe reduces the priority of this, but am reporting it for completeness.

Reproduction steps:
  1. Install and run QGIS 2.18.13
  2. Create a new shapefile layer of type "line"
  3. Ensure that snapping is enabled - an example setup is shown in the attached video
  4. Add a new line feature
  5. Ensure that the advanced digitizing tools are active
  6. Place the first point of a new line feature
  7. Using the advanced digitizing tool "Perpendicular" button, set this new line to be drawn perpendicular to the first
  8. Zoom in to the point where the new line is set to intersect the first (the scale in the attachment is 220:1)
  9. As the new line approaches the old, observe that the snapping point jumps off of it's "guide" line
  10. Observe that, if the new line is instead drawn beyond the first, it will follow the guide line as expected

QGIS-Snap-Error.mov - First shows the snapping rounding error, followed by the "overdraw" workaround (516 KB) Kyle Welsh, 2017-10-24 06:29 PM

QGIS 17324 BugReport.zip (13.6 KB) Kyle Welsh, 2017-10-26 11:57 AM

History

#1 Updated by Giovanni Manghi about 3 years ago

  • Status changed from Open to Feedback

genuinely asking: does it make sense digitizing at 220:1 scale? what is your configured snapping distance?

does it works correctly if you digitize at a "normal" scale?

#2 Updated by Kyle Welsh about 3 years ago

Hi Giovanni,

That scale was used to more clearly show the defect. The same thing will occur at more "normal" scales.
The configured snapping tolerance is 15 pixels (if there's another variable for snapping distance, I'm unsure where to find it).

Obviously the longer the new line is, the less violent the "snap" is in terms of how far the angle is from 90, but it seemed worth reporting as it's no longer actually perpendicular.

#3 Updated by Giovanni Manghi about 3 years ago

Kyle Welsh wrote:

Hi Giovanni,

That scale was used to more clearly show the defect. The same thing will occur at more "normal" scales.
The configured snapping tolerance is 15 pixels (if there's another variable for snapping distance, I'm unsure where to find it).

Obviously the longer the new line is, the less violent the "snap" is in terms of how far the angle is from 90, but it seemed worth reporting as it's no longer actually perpendicular.

do you have snapping enabled also for the other layer?

#4 Updated by Kyle Welsh about 3 years ago

Yes; snapping is set to "all visible layers".
This same issue would occur within a single layer, the red and blue are being used to show the defect more clearly (as mentioned in the report description).

#5 Updated by Giovanni Manghi about 3 years ago

Please attach the sample project (and data) taking care to attach a version that has the snapping settings that you think are creating this issue.

#6 Updated by Kyle Welsh about 3 years ago

Have uploaded a zip of the project and line layers, with snapping settings set as they were when the defect was reproduced (also visible in the attached video)

#7 Updated by Giovanni Manghi about 3 years ago

I cannot replicate with you project, configurations and data. Try a clean install (no 3rd party plugins, no legacy configurations... (backup and) remove the .qgis2 folder as a start).

#8 Updated by Kyle Welsh about 3 years ago

On clean install of 2.18.13 it's still present, but is very minor (<1mm out of place).
Minor enough that the digitizing tools don't even realise that it's not 90 degrees if the line is long enough.

#9 Updated by Giovanni Manghi about 3 years ago

Kyle Welsh wrote:

On clean install of 2.18.13 it's still present, but is very minor (<1mm out of place).
Minor enough that the digitizing tools don't even realise that it's not 90 degrees if the line is long enough.

so you had a 3rd party plugin or a legacy config causing the issue. Can we close this?

#10 Updated by Kyle Welsh about 3 years ago

Can only assume that that's the case. Believe the defect is minor enough that it can be closed.

#11 Updated by Giovanni Manghi about 3 years ago

  • Resolution set to invalid
  • Status changed from Feedback to Closed

Also available in: Atom PDF