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

Snapping and vertex tool not working with some layers if snapping was enabled when loaded #33449

Closed
borysiasty opened this issue Dec 17, 2019 · 6 comments
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 High Priority Regression Something which used to work, but doesn't anymore
Milestone

Comments

@borysiasty
Copy link
Member

borysiasty commented Dec 17, 2019

It's a regression between 3.10 and 3.11/master.

With snapping enabled, if I open either:

  • an empty PostGIS layer
  • a memory layer without any attributes

and add any features, snapping doesn't work, what makes also the vertex tool unable to find and highlight any feature.

Steps to reproduce

  1. Ensure the snapping is ON during steps 1 and 2.
  2. Either open an empty PostGIS layer, or a new memory layer without any fields
  3. Add any feature
  4. Try to edit vertices - doesn't work
  5. Try to save changes, re-enter the edit mode etc - nothing helps
  6. Load the layer again (now it's not empty during loading)
  7. Try to edit vertices - now it works!
  8. Add more features - still the vertex tool works fine, also on new features
  9. Remove all features and GO TO 0. It doesn't work again
@borysiasty borysiasty added Regression Something which used to work, but doesn't anymore Bug Either a bug report, or a bug fix. Let's hope for the latter! Digitizing Related to feature digitizing map tools or functionality labels Dec 17, 2019
@borysiasty borysiasty added this to the 3.12.0 milestone Jan 10, 2020
@troopa81
Copy link
Contributor

I failed to reproduce the issue on both Linux and Windows with master (updated yesterday)

Here is what I am doing, to be sure I don't misunderstand the process

bugsnap

@gioman gioman added the Feedback Waiting on the submitter for answers label Jan 10, 2020
@borysiasty
Copy link
Member Author

borysiasty commented Jan 11, 2020

@troopa81 :
Do you have snapping enabled? I made hundreds additional tests ;) and realized it's dependent on the snapping state during layer loading and then entering the edit mode:

  1. If snapping is OFF all the time when loading the layer and entering the edit mode: everything works.

  2. If snapping is ON all the time when loading the layer and entering the edit mode: the bug occurs.

If I toggle snapping between loading the layer and entering the edit mode:

  1. Snapping is OFF during layer loading and then switched ON before entering the edit mode - the bug occurs.

  2. Snapping is ON during layer loading and then switched OFF before entering the edit mode - the results are mixed (random or rather dependant on something else).

All the four cases above refer to the first edit session after the layer is loaded. Then, if you rollback the edit mode and enter it again with snapping ON or OFF, the results seem to be persistent (I mean the same as in the first edit session) until the layer is removed from the project.

If you remove the layer and load it again, all symptoms seem to be reset, so you can start another test without any need of using multiple layers nor restarting QGIS in order to get replicable results.

@borysiasty
Copy link
Member Author

In case 1) above, you can safely turn snapping on not earlier than after adding the first feature to the editing buffer.

@borysiasty borysiasty changed the title Vertex tool not working with PostGIS layers that were empty when opened. Snapping and vertex tool not working with PostGIS layers if the layer was empty and the snapping was enabled when loaded Jan 11, 2020
@gioman gioman removed the Feedback Waiting on the submitter for answers label Jan 12, 2020
@borysiasty borysiasty changed the title Snapping and vertex tool not working with PostGIS layers if the layer was empty and the snapping was enabled when loaded Snapping and vertex tool not working with some layers if snapping was enabled when loaded Jan 12, 2020
@troopa81
Copy link
Contributor

If snapping is ON all the time when loading the layer and entering the edit mode: the bug occurs

That was it, I manage to reproduce now. Thanks for the details, I'll fix it.

@Luckless1167
Copy link

It seems this bug is back in 3.34.0, if i load in the layers into my project when the snapping is enabled, snapping and vortex tool wont work. My fix is to close the program, relaunch and load all the layers then turn on the snapping tool.

@troopa81
Copy link
Contributor

@Luckless1167 I'll take a look next bug fix session

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 High Priority Regression Something which used to work, but doesn't anymore
Projects
None yet
Development

No branches or pull requests

4 participants