From 2e92dabd20df1abbc0e350dbd1ae06c0ad1839ce Mon Sep 17 00:00:00 2001 From: lbartoletti Date: Wed, 30 Jan 2019 15:45:02 +0100 Subject: [PATCH] [Processing][Grass] Add the possibility to return a shp if ogr is not compiled with gpkg --- .../processing/algs/grass7/Grass7AlgorithmProvider.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python/plugins/processing/algs/grass7/Grass7AlgorithmProvider.py b/python/plugins/processing/algs/grass7/Grass7AlgorithmProvider.py index 95a3b168da09..fe2c5848f7dc 100644 --- a/python/plugins/processing/algs/grass7/Grass7AlgorithmProvider.py +++ b/python/plugins/processing/algs/grass7/Grass7AlgorithmProvider.py @@ -138,7 +138,13 @@ def svgIconPath(self): return QgsApplication.iconPath("/providerGrass.svg") def defaultVectorFileExtension(self, hasGeometry=True): - return 'gpkg' + # By default,'gpkg', but if OGR has not been compiled with sqlite3, then + # we take "SHP" + if 'GPKG' in [o.driverName for o in + QgsVectorFileWriter.ogrDriverList()]: + return 'gpkg' + else: + return 'shp' if hasGeometry else 'dbf' def supportsNonFileBasedOutput(self): """