[gdal-dev] GIS Stack Exchange questions - delete geopackage layer
jratike80
jukka.rahkonen at maanmittauslaitos.fi
Thu Oct 17 06:24:53 PDT 2019
Hi,
Actually this is the official GDAL support channel so no need to be sorry.
While I am sure that DeleteLayer works when used correctly there is also
another option to execute SQL “DROP TABLE layer_name” as documented in
https://gdal.org/drivers/vector/gpkg.html.
-Jukka Rahkonen-
Stephen Knox wrote
> 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
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at .osgeo
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
More information about the gdal-dev
mailing list