[gdal-dev] GIS Stack Exchange questions - delete geopackage layer

Stephen Knox stephenknox73 at gmail.com
Thu Oct 17 06:11:45 PDT 2019


I've got a couple of questions here - I know this is not an official
support channel, but wondered if anyone could take a look, particularly at
the first one, which I will reproduce here. Thanks in advance.

https://gis.stackexchange.com/questions/339011/gdal-delete-geopackage-layer

This seems like it ought to be straightforward:

from osgeo import gdal
gpkg =
gdal.OpenEx('path_to_gpk',gdal.OF_VERBOSE_ERROR,allowed_drivers=['GPKG'])
error = gpkg.DeleteLayer(0)
After running this error is always a OGRERR_FAILURE. The geopackage has
been created by QGIS so I would have thought should be standard.

Can't see any way to debug further into the GDAL calls apart from a GDB
session, which I might try later.

-----------------------------------------------------------
https://gis.stackexchange.com/questions/338190/specify-open-options-in-datasource
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20191017/4f314ea7/attachment-0001.html>


More information about the gdal-dev mailing list