[gdal-dev] Invalid GeoPackage 'gpkg_metadata_reference_column_name_update' trigger

Even Rouault even.rouault at spatialys.com
Mon Sep 17 00:33:09 PDT 2018


Hi,

Testing the fresh new SQLite 3.25.0 on our GeoPacakge related autotests,
I discovered two issues:

* a bug in SQLite 3.25.0 itself which is triggered when renaming a table/layer,
and prevents the renaming to complete. The SQLite author has already fixed that per
https://www.sqlite.org/src/info/05a9d129254e01a5 and so this will
be available in the next SQLite version

* a bug in the definition of the 'gpkg_metadata_reference_column_name_update'
trigger as written in the current GeoPacakge spec. Raised as
https://github.com/opengeospatial/geopackage/pull/463 . This invalid definition
will cause next SQLite versions to refuse renaming tables when this trigger is
present (it is only installed by GDAL if metadata is written in the GeoPackage)
I've committed a fix in GDAL master and 2.3 branch to use the corrected trigger
definition when creating new GeoPackage DBs.
For existing GeoPackage DBs (this should mostly affect databases with raster),
you can use (verified to work with GDAL 2.2 and later) the following script to fix them:
https://raw.githubusercontent.com/OSGeo/gdal/master/gdal/swig/python/samples/fix_gpkg.py

python fix_gpkg.py my.gpkg
or
python fix_gpkg.py *.gpkg

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list