-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Delete field in table delete all features #28585
Comments
Author Name: Nyall Dawson (@nyalldawson)
Have you got the actual error? Can you share the original file and steps to reproduce?
|
Author Name: Lene Fischer (@LeneFischer) I have tried to replicate the error message but it does not appear any longer.
|
Author Name: Lene Fischer (@LeneFischer) When I close the file and re-open I get a message : WARNING CRS was undefined : defaulting to CRS EPSG:25832 - ETRS89 / UTM zone 32N |
Author Name: Jérôme Guélat (Jérôme Guélat) I'm experiencing the same bug... Suprisingly this doesn't happen if you save the layer to a new GeoPackage and then delete one column in the new GeoPackage. The problem is also occurring with QGIS 2.18.26 (and QGIS is even crashing). I've also checked on my Mac and it works perfectly, using the same GDAL version as the Windows version (2.3.2). |
Author Name: Jérôme Guélat (Jérôme Guélat) Exporting the whole GeoPackage with ogr2ogr using the following command also helps: ogr2ogr newgeopackage.gpkg skovkort.gpkg I've first thought the problem was related to the GeoPackage version since I've only had problems with GeoPackages using version 1.0 (and not with version 1.2 which is now the default when using GDAL 2.3.2) but this doesn't seem to be the cause since the problem is also solved if I force ogr2ogr to export in version 1.0 (ogr2ogr newgeopackage.gpkg skovkort.gpkg -dsco VERSION=1.0). |
Author Name: Jérôme Guélat (Jérôme Guélat) It is fortunately possible to recover the data... Open the GeoPackage with an SQLite editor (e.g., https://sqlitebrowser.org) and look for the table with the removed column. If your table/layer was called foo, then look for a table named foo_ogr_tmp. Rename this table using the original name (foo). QGIS will again be able to open the GeoPackage layer. |
Author Name: Giovanni Manghi (@gioman) Lene Fischer wrote:
so you can't replicate the problem in a consistent manner? |
Author Name: Lene Fischer (@LeneFischer) I can easily replicate the problem - but not the error message. I think that it initially was a multiple session of deleting and creating fields that caused the OGR error message. |
Author Name: Giovanni Manghi (@gioman) Confirmed on master on clean Windows 10 and QGIS installations. This is VERY bad.
|
Author Name: Jürgen Fischer (@jef-n)
When trying to save all data vanished. We were not able to undo. Error message was something about OGR.. This happend for all the students with version 3.4.2 Windows Not sure if it´s the same issue as https://issues.qgis.org/issues/20507 to To in a lecture today we should delete a field in a table. Geopackage. When trying to save all data vanished. We were not able to undo. Error message was something about OGR.. This happend for all the students with version 3.4.2 Windows Not sure if it´s the same issue as #28327 |
Author Name: Alessandro Pasotti (@elpaso) This is probably an upstream bug in OGR/GDAL or the underlying sqlite libraries. I checked with a debugger on windows and QGIS is not doing anything strange: it calls the right OGR function with the right parameters, the call returns no errors but the table is completely removed from the DB (that's why QGIS asks for the CRS when re-opened). |
Author Name: Jérôme Guélat (Jérôme Guélat) You're right... I think I remember that SQLite was updated with QGIS 3.4.2. Using OSGeo4W I downgraded SQLite from 3.25 to 3.17 and the bug is gone. |
Author Name: Jérôme Guélat (Jérôme Guélat) Unfortunately the bug is also occurring with this version. |
Author Name: Even Rouault (@rouault) OK, I believe this is the issue that was fixed per OSGeo/gdal@556738b in GDAL 2.4.0 |
Author Name: Jérôme Guélat (Jérôme Guélat) Thanks for having a look at it. Indeed this seeems to be the problem... If I correct the trigger in the "older" GeoPackages, then the issue doesn't occur. Would it be possible to correct this trigger automatically when the incorrect one is detected in a GeoPackage used in QGIS? |
Author Name: Giovanni Manghi (@gioman) Jérôme Guélat wrote:
I think this should be filed as feature request.
|
Fixed by #43309, #43322, OSGeo/gdal#3863. |
Author Name: Lene Fischer (@LeneFischer)
Original Redmine Issue: 20765
Affected QGIS version: 3.5(master)
Redmine category:data_provider/ogr
To in a lecture today we should delete a field in a table. Geopackage.
When trying to save all data vanished. We were not able to undo.
When closing and opening again the open dialog showed 160 features - but none in the attribute tabel.
Error message was something about OGR..
This happend for all the students with version 3.4.2 Windows
Students with 3.4.1 had no problem - and the same for students with 3.4.2 Mac - (great fun because it´s alwas the Mac users who are having difficulties..)
Not sure if it´s the same issue as #28327
The text was updated successfully, but these errors were encountered: