Skip to content
Permalink
Browse files

[processing] fixed saga split rgb for 2.1.4

  • Loading branch information
volaya committed Apr 28, 2015
1 parent 8ac22c5 commit 295014647f6f1812fc809c08bad3fbc457057ad9
Showing with 12 additions and 24 deletions.
  1. +12 −24 python/plugins/processing/algs/saga/SplitRGBBands.py
@@ -70,30 +70,18 @@ def processAlgorithm(self, progress):
g = self.getOutputValue(SplitRGBBands.G)
b = self.getOutputValue(SplitRGBBands.B)
commands = []
if isWindows():
commands.append('io_gdal 0 -GRIDS "' + temp + '" -FILES "' + input
+ '"')
commands.append('io_gdal 1 -GRIDS "' + temp
+ '_0001.sgrd" -FORMAT 1 -TYPE 0 -FILE "' + r + '"'
)
commands.append('io_gdal 1 -GRIDS "' + temp
+ '_0002.sgrd" -FORMAT 1 -TYPE 0 -FILE "' + g + '"'
)
commands.append('io_gdal 1 -GRIDS "' + temp
+ '_0003.sgrd" -FORMAT 1 -TYPE 0 -FILE "' + b + '"'
)
else:
commands.append('libio_gdal 0 -GRIDS "' + temp + '" -FILES "'
+ input + '"')
commands.append('libio_gdal 1 -GRIDS "' + temp
+ '_0001.sgrd" -FORMAT 1 -TYPE 0 -FILE "' + r + '"'
)
commands.append('libio_gdal 1 -GRIDS "' + temp
+ '_0002.sgrd" -FORMAT 1 -TYPE 0 -FILE "' + g + '"'
)
commands.append('libio_gdal 1 -GRIDS "' + temp
+ '_0003.sgrd" -FORMAT 1 -TYPE 0 -FILE "' + b + '"'
)
version = SagaUtils.getSagaInstalledVersion(True)
trailing = "000" if version != "2.1.4" else ""
lib = "" if isWindows() else "lib"
commands.append('%sio_gdal 0 -GRIDS "%s" -FILES "%s"' % (lib, temp, input)
+ '"')
commands.append('%sio_gdal 1 -GRIDS "%s_%s1.sgrd" -FORMAT 1 -TYPE 0 -FILE "%s"' %(lib, temp, trailing, r)
)
commands.append('%sio_gdal 1 -GRIDS "%s_%s2.sgrd" -FORMAT 1 -TYPE 0 -FILE "%s"' %(lib, temp, trailing, g)
)
commands.append('%sio_gdal 1 -GRIDS "%s_%s3.sgrd" -FORMAT 1 -TYPE 0 -FILE "%s"' %(lib, temp, trailing, b)
)


SagaUtils.createSagaBatchJobFileFromSagaCommands(commands)
SagaUtils.executeSaga(progress)

0 comments on commit 2950146

Please sign in to comment.
You can’t perform that action at this time.