I'm looking for a pythonic way to add style layers to a Geopackage. I've checked out this and this, and both show how to do it in QGIS gui but not Python. I have a .sld file and want to add it to the GPKG as the default style. Is there an easy way to accomplish this?

I've tried

trans_kwargs = {
creation_options = ['APPEND_SUBDATASET=YES']
gdal.Translate('test.gpkg', 'test_style.sld', **trans_kwargs, creationOptions=creation_options)

but get the following error.

ValueError: Received a NULL pointer.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.