Bug report #16076
Updated by Johannes Kroeger over 5 years ago
Opening a Vector Geopackage in QGIS alters its file. Simply loading the file is enough, you do not even need to load any actual data (visibly to the user).
<pre>
$ wget http://www.geopackage.org/data/geonames_belgium.gpkg
2017-01-13 17:58:54 (1.28 MB/s) - ‘geonames_belgium.gpkg’ saved [11594752/11594752]
$ cp geonames_belgium.gpkg geonames_belgium.gpkg_original
$ md5sum geonames_belgium.gpkg*
4dacf68ae3a5f2c2fb55a35d062dc580 geonames_belgium.gpkg
4dacf68ae3a5f2c2fb55a35d062dc580 geonames_belgium.gpkg_original
$ ogrinfo -so geonames_belgium.gpkg
INFO: Open of `geonames_belgium.gpkg'
using driver `GPKG' successful.
1: administrative (3D Measured Point)
2: hydrography (3D Measured Point)
3: leisure (3D Measured Point)
4: places (3D Measured Point)
5: roads (3D Measured Point)
6: spots (3D Measured Point)
7: terrain (3D Measured Point)
8: undersea (3D Measured Point)
9: vegetation (3D Measured Point)
$ md5sum geonames_belgium.gpkg*
4dacf68ae3a5f2c2fb55a35d062dc580 geonames_belgium.gpkg
4dacf68ae3a5f2c2fb55a35d062dc580 geonames_belgium.gpkg_original
hannes@hilmar:/mnt/earx/geodata$ qgis geonames_belgium.gpkg
Warning: loading of qgis translation failed [/usr/share/qgis/i18n//qgis_en_US]
Warning: loading of qt translation failed [/usr/share/qt/translations/qt_en_US]
Warning: QCss::Parser - Failed to load file "/style.qss"
</pre>
Here the layer chooser dialog appeared on which I clicked Cancel and quit QGIS.
<pre>
$ md5sum geonames_belgium.gpkg*
99fad69efe058b1d308088b96d60e915 geonames_belgium.gpkg
4dacf68ae3a5f2c2fb55a35d062dc580 geonames_belgium.gpkg_original
</pre>
QGIS changes only some stuff in the header:
<pre>
$ hexdump -C geonames_belgium.gpkg > geonames_belgium.gpkg.hex
$ hexdump -C geonames_belgium.gpkg_original > geonames_belgium.gpkg_original.hex
$ diff geonames_belgium.gpkg*.hex
2c2
< 00000010 04 00 01 01 00 40 20 20 00 00 00 56 00 00 2c 3b |.....@ ...V..,;|
---
> 00000010 04 00 01 01 00 40 20 20 00 00 00 54 00 00 2c 3b |.....@ ...T..,;|
6,7c6,7
< 00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 56 |...............V|
< 00000060 00 2e 05 42 05 00 00 00 26 03 42 00 00 00 2c 3b |...B....&.B...,;|
---
> 00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 54 |...............T|
> 00000060 00 2d e6 06 05 00 00 00 26 03 42 00 00 00 2c 3b |.-......&.B...,;|
</pre>
I could not reproduce this bug with the Raster GPKG https://portal.opengeospatial.org/files/63156 but with any other Vector GPKG I tried.
Please ensure that merely opening a file does never alter it.
<pre>
$ wget http://www.geopackage.org/data/geonames_belgium.gpkg
2017-01-13 17:58:54 (1.28 MB/s) - ‘geonames_belgium.gpkg’ saved [11594752/11594752]
$ cp geonames_belgium.gpkg geonames_belgium.gpkg_original
$ md5sum geonames_belgium.gpkg*
4dacf68ae3a5f2c2fb55a35d062dc580 geonames_belgium.gpkg
4dacf68ae3a5f2c2fb55a35d062dc580 geonames_belgium.gpkg_original
$ ogrinfo -so geonames_belgium.gpkg
INFO: Open of `geonames_belgium.gpkg'
using driver `GPKG' successful.
1: administrative (3D Measured Point)
2: hydrography (3D Measured Point)
3: leisure (3D Measured Point)
4: places (3D Measured Point)
5: roads (3D Measured Point)
6: spots (3D Measured Point)
7: terrain (3D Measured Point)
8: undersea (3D Measured Point)
9: vegetation (3D Measured Point)
$ md5sum geonames_belgium.gpkg*
4dacf68ae3a5f2c2fb55a35d062dc580 geonames_belgium.gpkg
4dacf68ae3a5f2c2fb55a35d062dc580 geonames_belgium.gpkg_original
hannes@hilmar:/mnt/earx/geodata$ qgis geonames_belgium.gpkg
Warning: loading of qgis translation failed [/usr/share/qgis/i18n//qgis_en_US]
Warning: loading of qt translation failed [/usr/share/qt/translations/qt_en_US]
Warning: QCss::Parser - Failed to load file "/style.qss"
</pre>
Here the layer chooser dialog appeared on which I clicked Cancel and quit QGIS.
<pre>
$ md5sum geonames_belgium.gpkg*
99fad69efe058b1d308088b96d60e915 geonames_belgium.gpkg
4dacf68ae3a5f2c2fb55a35d062dc580 geonames_belgium.gpkg_original
</pre>
QGIS changes only some stuff in the header:
<pre>
$ hexdump -C geonames_belgium.gpkg > geonames_belgium.gpkg.hex
$ hexdump -C geonames_belgium.gpkg_original > geonames_belgium.gpkg_original.hex
$ diff geonames_belgium.gpkg*.hex
2c2
< 00000010 04 00 01 01 00 40 20 20 00 00 00 56 00 00 2c 3b |.....@ ...V..,;|
---
> 00000010 04 00 01 01 00 40 20 20 00 00 00 54 00 00 2c 3b |.....@ ...T..,;|
6,7c6,7
< 00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 56 |...............V|
< 00000060 00 2e 05 42 05 00 00 00 26 03 42 00 00 00 2c 3b |...B....&.B...,;|
---
> 00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 54 |...............T|
> 00000060 00 2d e6 06 05 00 00 00 26 03 42 00 00 00 2c 3b |.-......&.B...,;|
</pre>
I could not reproduce this bug with the Raster GPKG https://portal.opengeospatial.org/files/63156 but with any other Vector GPKG I tried.
Please ensure that merely opening a file does never alter it.