Skip to content

Commit

Permalink
[processing][GRASS] Fix some algorithms always export as GPKG, regard…
Browse files Browse the repository at this point in the history
…less of format selected
  • Loading branch information
nyalldawson committed Jun 1, 2018
1 parent 60a87e9 commit 30ecb33
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/plugins/processing/algs/grass7/Grass7Algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ def exportVectorLayerFromParameter(self, name, parameters, context, layer=None,
self.exportVectorLayer(grassName, fileName, layer, nocats, dataType, outFormat, dsco, lco)

def exportVectorLayer(self, grassName, fileName, layer=None, nocats=False, dataType='auto',
outFormat='GPKG', dsco=None, lco=None):
outFormat=None, dsco=None, lco=None):
"""
Creates a dedicated command to export a vector from
temporary GRASS DB into a file via OGR.
Expand All @@ -885,6 +885,9 @@ def exportVectorLayer(self, grassName, fileName, layer=None, nocats=False, dataT
:param dsco: datasource creation options for format.
:param lco: layer creation options for format.
"""
if outFormat is None:
outFormat = QgsVectorFileWriter.driverForExtension(os.path.splitext(fileName)[1]).replace(' ', '_')

for cmd in [self.commands, self.outputCommands]:
cmd.append(
'v.out.ogr{0} type="{1}" input="{2}" output="{3}" format="{4}" {5}{6}{7} --overwrite'.format(
Expand Down

0 comments on commit 30ecb33

Please sign in to comment.