Skip to content

Commit 2e92dab

Browse files
lbartolettinyalldawson
authored andcommittedJan 30, 2019
[Processing][Grass] Add the possibility to return a shp if ogr is not compiled with gpkg
1 parent 662af5c commit 2e92dab

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

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

Lines changed: 7 additions & 1 deletion
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)
Please sign in to comment.