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

Merge tool bug when a shapefile is loaded multiple times #16483

Closed
qgib opened this issue Apr 7, 2013 · 23 comments
Closed

Merge tool bug when a shapefile is loaded multiple times #16483

qgib opened this issue Apr 7, 2013 · 23 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption Digitizing Related to feature digitizing map tools or functionality

Comments

@qgib
Copy link
Contributor

qgib commented Apr 7, 2013

Author Name: Olivier Dalang (@olivierdalang)
Original Redmine Issue: 7540
Affected QGIS version: master
Redmine category:digitising


Hi !

When a Shapefile is loaded multiple times (either in the same project via "duplicate layer" or in two different QGis instances), there is a critical bug upon merging features.

Both merged parts simply disappear without any error (though it seems sometimes QGis crashes).

To reproduce:

  1. create a new shapefile (line or polygon)
  2. enter edit mode
  3. draw a feature and split it several times with the scissor tool
  4. exit edit mode
  5. duplicate the layer
  6. enter edit mode on one of the two layers
  7. select two line segments and merge them with the merge tool
  8. exit edit mode
  9. reload the project and see!!

Related issue(s): #17515 (relates)
Redmine related issue(s): 8822


@qgib
Copy link
Contributor Author

qgib commented Apr 8, 2013

Author Name: Giovanni Manghi (@gioman)


it is a regression since 1.8? I'm not able to replicate the issue here, but maybe I'm doing it wrong.


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Apr 8, 2013

Author Name: Olivier Dalang (@olivierdalang)


Yes it's a regression, the problem does not show up in 1.8...

Here (Windows 7) it seems to happen every time when following those steps.

If confirmed, this should be a blocker, since it leads to data corruption.

@qgib
Copy link
Contributor Author

qgib commented Apr 8, 2013

Author Name: Giovanni Manghi (@gioman)


  • priority_id was changed from Normal to Severe/Regression

@qgib
Copy link
Contributor Author

qgib commented Apr 22, 2013

Author Name: Radim Blazek (@blazek)


  1. reload the project and see !!

What does it mean "reload the project"? Reopen project file or refresh display?

@qgib
Copy link
Contributor Author

qgib commented Apr 22, 2013

Author Name: Olivier Dalang (@olivierdalang)


Actually, when you refresh display only :

  • on the layer that was not edited, you see that the two merged parts have disappeared
  • on the layer that was edited, you see the two merged parts plus the result of the merge

But actually, I'm just discovering that the shapefile seems in a deeper mess, even after reloading : if you create a new polygon, no matter what shape, it will take the shape of the result of the merge.

Here's a screencast of the procedure :
https://www.dropbox.com/s/84nj515s6mfu09f/mergeBug2.avi?m

@qgib
Copy link
Contributor Author

qgib commented Jun 1, 2013

Author Name: Giovanni Manghi (@gioman)


  • status_id was changed from Feedback to Open

@qgib
Copy link
Contributor Author

qgib commented Jun 27, 2013

Author Name: Giovanni Manghi (@gioman)


  • category_id was configured as Digitising

@qgib
Copy link
Contributor Author

qgib commented Jul 1, 2013

Author Name: Salvatore Larosa (@slarosa)


is it still true ?

following the above steps I did not get any crash !
tested with a polygon layer and I do not see unusual behavior.

@qgib
Copy link
Contributor Author

qgib commented Jul 2, 2013

Author Name: Giovanni Manghi (@gioman)


following the above steps I did not get any crash !
tested with a polygon layer and I do not see unusual behavior.

I don't think it causes crash, it causes data corruption.

@qgib
Copy link
Contributor Author

qgib commented Jul 8, 2013

Author Name: Jürgen Fischer (@jef-n)


Giovanni Manghi wrote:

I don't think it causes crash, it causes data corruption.

So you can reproduce the problem? Just checking, if I should try harder...


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Jul 8, 2013

Author Name: Giovanni Manghi (@gioman)


So you can reproduce the problem? Just checking, if I should try harder...

no I can't.

Olivier still true for you?

@qgib
Copy link
Contributor Author

qgib commented Jul 8, 2013

Author Name: Olivier Dalang (@olivierdalang)


Hi !

The behavior changed a little bit but I still get data corruption (with master from yesterday, under Windows 7).
It's no more necessary to reload the project to see the data loss.

Here's a screencast : https://www.dropbox.com/s/g70fkaus6j40vll/mergeBug4.avi

@qgib
Copy link
Contributor Author

qgib commented Jul 9, 2013

Author Name: Jürgen Fischer (@jef-n)


ok, I can reproduce it now. I suspect it's a file locking issue in OGR (might be tied to windows). Looking into GDAL now...


  • status_id was changed from Feedback to Open

@qgib
Copy link
Contributor Author

qgib commented Jul 9, 2013

Author Name: Jürgen Fischer (@jef-n)


  • assigned_to_id was configured as Jürgen Fischer

@qgib
Copy link
Contributor Author

qgib commented Jul 9, 2013

Author Name: Jürgen Fischer (@jef-n)


Fixed in changeset "78b04df91a1b85ee70ff5b326980f480b3069d47".


  • status_id was changed from Open to Closed

@qgib
Copy link
Contributor Author

qgib commented Jul 9, 2013

Author Name: Jürgen Fischer (@jef-n)


Jürgen Fischer wrote:

Fixed in changeset "78b04df91a1b85ee70ff5b326980f480b3069d47".

It was caused by locking. QGIS does a REPACK after deleting and that silently fails with current OGR. "GDAL pull request !#17":OSGeo/gdal#17 should fix this by adding an error message. reopening the original DBF if it can't be removed and cleaning up the @*_packed.dbf@.

Nevertheless QGIS now checks if there still is a @*_packed.dbf@ to detect that the REPACK failed and reopens the dataset in that case.

@qgib
Copy link
Contributor Author

qgib commented Oct 4, 2014

Author Name: Giovanni Manghi (@gioman)


Sorry to reopen this, seems master still affected. See also #19415


  • status_id was changed from Closed to Reopened
  • fixed_version_id was changed from Version 2.0.0 to Version 2.6

@qgib
Copy link
Contributor Author

qgib commented Oct 21, 2014

Author Name: Jürgen Fischer (@jef-n)


  • assigned_to_id removed Jürgen Fischer

@qgib
Copy link
Contributor Author

qgib commented Oct 24, 2014

Author Name: Giovanni Manghi (@gioman)


it is pretty easy to replicate this issue, it is just needed to "insist" a bit. Here two screencast, that as some point show that after removing a shape and re-adding it features are lost!

The second show also a possible bug in the "split features" tool.

https://www.dropbox.com/s/rpjcn8gpn75r31m/t7540_1.mp4?dl=0

https://www.dropbox.com/s/9n9a7j1puugwpnr/t7540_2.mp4?dl=0

@qgib
Copy link
Contributor Author

qgib commented Oct 24, 2014

Author Name: Giovanni Manghi (@gioman)


Giovanni Manghi wrote:

Sorry to reopen this, seems master still affected. See also #19415

after all it does not seems related... I have a VM with qgis running against gdal/ogr trunk and I can still see the issue described in this ticket.

@qgib
Copy link
Contributor Author

qgib commented Oct 30, 2014

Author Name: Giovanni Manghi (@gioman)


it seems this could have been solved by this 4cf08c5


  • status_id was changed from Reopened to Feedback

@qgib
Copy link
Contributor Author

qgib commented Oct 31, 2014

Author Name: Jürgen Fischer (@jef-n)


  • fixed_version_id was changed from Version 2.6 to Future Release - High Priority

@qgib
Copy link
Contributor Author

qgib commented Nov 3, 2014

Author Name: Giovanni Manghi (@gioman)


after 4cf08c5 I really cannot make to replicate this issue. That commit solves also partially #19349 (but only for the case of edited features, still there is an issue with deleted ones).

Please reopen if necessary.


  • status_id was changed from Feedback to Closed
  • resolution was changed from to fixed/implemented

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Digitizing Related to feature digitizing map tools or functionality Crash/Data Corruption labels May 24, 2019
@qgib qgib added this to the Future Release - High Priority milestone May 24, 2019
@qgib qgib closed this as completed May 24, 2019
JamesShaeffer pushed a commit to JamesShaeffer/QGIS that referenced this issue Nov 20, 2019
Should technically be MultiPoint ((-20 -90), (-20 -88)), but
it's nice to be forgiving and accept as wide a range of WKT
formats as possible

Fix qgis#16483

(cherry-picked from ef6c8b)
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! Crash/Data Corruption Digitizing Related to feature digitizing map tools or functionality
Projects
None yet
Development

No branches or pull requests

1 participant