Skip to content

Commit

Permalink
Rename parameter to convert all layers
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitblanc authored and nyalldawson committed Dec 9, 2021
1 parent 495af5a commit 03d495c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions python/plugins/processing/algs/gdal/ogr2ogr.py
Expand Up @@ -36,7 +36,7 @@

class ogr2ogr(GdalAlgorithm):
INPUT = 'INPUT'
IGNORE_LAYERNAME = 'IGNORE_LAYERNAME'
CONVERT_ALL_LAYERS = 'CONVERT_ALL_LAYERS'
OPTIONS = 'OPTIONS'
OUTPUT = 'OUTPUT'

Expand All @@ -48,8 +48,8 @@ def initAlgorithm(self, config=None):
self.tr('Input layer'),
types=[QgsProcessing.TypeVector]))

self.addParameter(QgsProcessingParameterBoolean(self.IGNORE_LAYERNAME,
self.tr('Ignore layer name'), defaultValue=False))
self.addParameter(QgsProcessingParameterBoolean(self.CONVERT_ALL_LAYERS,
self.tr('Convert all layers from dataset'), defaultValue=False))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation options'),
Expand Down Expand Up @@ -78,7 +78,7 @@ def commandName(self):

def getConsoleCommands(self, parameters, context, feedback, executing=True):
ogrLayer, layerName = self.getOgrCompatibleSource(self.INPUT, parameters, context, feedback, executing)
ignoreLayerName = self.parameterAsBoolean(parameters, self.IGNORE_LAYERNAME, context)
convertAllLayers = self.parameterAsBoolean(parameters, self.CONVERT_ALL_LAYERS, context)
options = self.parameterAsString(parameters, self.OPTIONS, context)
outFile = self.parameterAsOutputLayer(parameters, self.OUTPUT, context)
self.setOutputValue(self.OUTPUT, outFile)
Expand All @@ -97,7 +97,7 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):

arguments.append(output)
arguments.append(ogrLayer)
if not ignoreLayerName:
if not convertAllLayers:
arguments.append(layerName)

return ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]

0 comments on commit 03d495c

Please sign in to comment.