Bug report #13256
Shapefile corrupted on edit
|Affected QGIS version:||2.10.1||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||21317|
I'm seeing some strange behavior on a shapefile I'm working with. If I draw a polygon in just the right spot and then save my edits, the polygon disappears. Any subsequent polygons that I draw and commit have the same problem. If I close QGIS, restart, and then add the same shapefile, the shape that I drew is visible, but seems to have issues. I can't always select it with the selection tool, for example.
I initially thought the issue might be that I was drawing shapes that were partially outside of the extents of the coordinate system of the projection on the shapefile, but if I draw other shapes far away from the other features and outside of the projection extents they draw and commit without problems.
A version of the shapefile that seems to be causing the problem is attached.
Steps to reproduce:
1 - Add test.shp to empty canvas
2 - Start edit session
3 - Draw new polygon at approximately the following coordinates (+/- 1,000 ft):
4 - Save edits
Newly drawn polygon disappears. Shapefile is corrupted in some way. No errors to indicate that there was a problem.
What should happen:
Changes are rolled back and an error message is produced. Even better, QGIS handles whatever issue and the shape is committed as drawn.
#1 Updated by Saber Razmjooei over 4 years ago
- File overlap.PNG added
- Status changed from Open to Feedback
QGIS doesn't seem to handle vectors with overlapping features properly and throws out some random errors when editing them.
Feature 4 and 10 in your shapefile contains some overlapping.
Could you remove those features and try again? Also, worth trying in QGIS master.
#2 Updated by Spencer Gardner over 4 years ago
OK. More weirdness. When I delete features 4 and 10, commit edits, turn off editing, and then zoom, all features in the shapefile disappear. If I close QGIS, reopen, and add the modified shapefile to the canvas, I can see the features until I zoom again at which point they disappear. Same behavior in the latest nightly.