5

Is there a PyQGIS way to check if an active layer iface.activeLayer() is not a GeoPackage format?

Taras
35.8k5 gold badges77 silver badges152 bronze badges
asked Apr 16, 2021 at 21:39
1

1 Answer 1

11

You can use:

if iface.activeLayer().storageType() != 'GPKG':
 print('Active layer is not a GeoPackage format')
Taras
35.8k5 gold badges77 silver badges152 bronze badges
answered Apr 16, 2021 at 21:51

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.