Skip to content

Commit e1febd0

Browse files
lbartolettinyalldawson
authored andcommitted
[Processing][Grass] Add the possibility to return a shp if ogr is not compiled with gpkg
(cherry picked from commit 2e92dab)
1 parent 06ee132 commit e1febd0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

python/plugins/processing/algs/grass7/Grass7AlgorithmProvider.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,13 @@ def svgIconPath(self):
138138
return QgsApplication.iconPath("/providerGrass.svg")
139139

140140
def defaultVectorFileExtension(self, hasGeometry=True):
141-
return 'gpkg'
141+
# By default,'gpkg', but if OGR has not been compiled with sqlite3, then
142+
# we take "SHP"
143+
if 'GPKG' in [o.driverName for o in
144+
QgsVectorFileWriter.ogrDriverList()]:
145+
return 'gpkg'
146+
else:
147+
return 'shp' if hasGeometry else 'dbf'
142148

143149
def supportsNonFileBasedOutput(self):
144150
"""

0 commit comments

Comments
 (0)