@@ -70,30 +70,18 @@ def processAlgorithm(self, progress):
70
70
g = self .getOutputValue (SplitRGBBands .G )
71
71
b = self .getOutputValue (SplitRGBBands .B )
72
72
commands = []
73
- if isWindows ():
74
- commands .append ('io_gdal 0 -GRIDS "' + temp + '" -FILES "' + input
75
- + '"' )
76
- commands .append ('io_gdal 1 -GRIDS "' + temp
77
- + '_0001.sgrd" -FORMAT 1 -TYPE 0 -FILE "' + r + '"'
78
- )
79
- commands .append ('io_gdal 1 -GRIDS "' + temp
80
- + '_0002.sgrd" -FORMAT 1 -TYPE 0 -FILE "' + g + '"'
81
- )
82
- commands .append ('io_gdal 1 -GRIDS "' + temp
83
- + '_0003.sgrd" -FORMAT 1 -TYPE 0 -FILE "' + b + '"'
84
- )
85
- else :
86
- commands .append ('libio_gdal 0 -GRIDS "' + temp + '" -FILES "'
87
- + input + '"' )
88
- commands .append ('libio_gdal 1 -GRIDS "' + temp
89
- + '_0001.sgrd" -FORMAT 1 -TYPE 0 -FILE "' + r + '"'
90
- )
91
- commands .append ('libio_gdal 1 -GRIDS "' + temp
92
- + '_0002.sgrd" -FORMAT 1 -TYPE 0 -FILE "' + g + '"'
93
- )
94
- commands .append ('libio_gdal 1 -GRIDS "' + temp
95
- + '_0003.sgrd" -FORMAT 1 -TYPE 0 -FILE "' + b + '"'
96
- )
73
+ version = SagaUtils .getSagaInstalledVersion (True )
74
+ trailing = "000" if version != "2.1.4" else ""
75
+ lib = "" if isWindows () else "lib"
76
+ commands .append ('%sio_gdal 0 -GRIDS "%s" -FILES "%s"' % (lib , temp , input )
77
+ + '"' )
78
+ commands .append ('%sio_gdal 1 -GRIDS "%s_%s1.sgrd" -FORMAT 1 -TYPE 0 -FILE "%s"' % (lib , temp , trailing , r )
79
+ )
80
+ commands .append ('%sio_gdal 1 -GRIDS "%s_%s2.sgrd" -FORMAT 1 -TYPE 0 -FILE "%s"' % (lib , temp , trailing , g )
81
+ )
82
+ commands .append ('%sio_gdal 1 -GRIDS "%s_%s3.sgrd" -FORMAT 1 -TYPE 0 -FILE "%s"' % (lib , temp , trailing , b )
83
+ )
84
+
97
85
98
86
SagaUtils .createSagaBatchJobFileFromSagaCommands (commands )
99
87
SagaUtils .executeSaga (progress )
0 commit comments