Jessy,
Trying to remove superfluous intermediate layers in a GPKG dataset.
The general logic is
Ds = ogr.open(fp)
I assume you meant ogr.Open(fp, update=True) otherwise you'd got another
type of error.
Lyr = ds.executesql(query)
Ds.DeleteLayer(idx) <- failed, database table is locked, may be caused
by “sqlite3_exec(DROP TABLE “rtree_layername_geom”) failed: database
table is locked
Is layer deletion not supported while a “result set” from a SQL query
is on the dataset is active? Perhaps importantly, the query sources
the deleted layer.
Yes most likely. Calling ds.ReleaseResultSet(Lyr) before should make
things work.
You could possibly also try to open the dataset after setting
gdal.SetConfigOption("OGR_SQLITE_JOURNAL", "WAL") , but I'm not positive
at all this would avoid this particular issue.
Even
--
http://www.spatialys.com
My software is free, but my time generally not.
Grumpy maintainer.
"De l'égo à l'égoût, il n'y a qu'une bouche mal refermée", André Isaac
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev