[GIS] SAGA algorithms not working on Qgis 2.18 on Mac OSX

macqgissaga

Since last update to Qgis 2.18 from 2.14, I'm unable to successfully run SAGA algorithms (Mac OSX Yosemite). No matters if it is vector- or raster-oriented algorithm, the algorithm stops at this point with a message similar to :

"..Converting outputs
Loading resulting layers
The following layers were not correctly generated.
Kernel
You can check the log messages to find more information about the execution of the algorithm"

I can run SAGA algorithms for tables, tough. (e.g. Running Average works well). This makes me think that SAGA is correctly installed.

What I've tried so far:

  • I've reinstalled Qgis from scratch.
  • I've the same problem in two different Macs
  • I've checked the options in Processing (there is no option for SAGA folder as before)
  • I've checked the advanced preferences in QGIS (also, there is no option for SAGA folder)
  • I've deleted the /Users/user/.qgis2 folder before installing 2.18

EDIT: SAGA version is 2.2.3. It is installed automatically with Qgis.

EDIT 2: Exactly same symptoms in a second Mac. Reinstalled Qgis 2.14 and SAGA is live again (Saga version in Qgis 2.14 seems to be 2.1.4).

EDIT 3: New attempt in a brand new Mac resulted in the same symptoms.

¿Any ideas?

I'm pasting the full log of a failed execution, if it helps.

Algorithm Add coordinates to points starting...
shapes_points "Add Coordinates to points" -INPUT "/var/folders/r2/b15t0jvd45x_s7r0h1cpc0zh0000gn/T/processing644d036e8bde4096a10cdf7e37ed56a5/1478841643.755.shp" -OUTPUT "/var/folders/r2/b15t0jvd45x_s7r0h1cpc0zh0000gn/T/processing644d036e8bde4096a10cdf7e37ed56a5/78dc7b6f275e49afb2ec5dc408bcc39e/OUTPUT.shp"
/Users/daniel/.qgis2//processing/saga_batch_job.sh: line 3: 5770 Segmentation fault: 11 saga_cmd shapes_points "Add Coordinates to points" -INPUT "/var/folders/r2/b15t0jvd45x_s7r0h1cpc0zh0000gn/T/processing644d036e8bde4096a10cdf7e37ed56a5/1478841643.755.shp" -OUTPUT "/var/folders/r2/b15t0jvd45x_s7r0h1cpc0zh0000gn/T/processing644d036e8bde4096a10cdf7e37ed56a5/78dc7b6f275e49afb2ec5dc408bcc39e/OUTPUT.shp"
Converting outputs
Loading resulting layers

The following layers were not correctly generated.
Points with coordinates
You can check the log messages to find more information about the execution of the algorithm

Best Answer

I think the problem is that the QGIS processing tools for SAGA are sending an incorrectly-named parameter to saga_cmd, both via the description files for the saga commands, and also in the the script SagaAlgorithm214.py. The correct parameter should be "RESAMPLING" but the QGIS processing files use "INTERPOL". (These files are found on my machine at /usr/share/qgis/python/plugins/processing/algs/saga/ and /usr/share/qgis/python/plugins/processing/algs/saga/description/2.2.3).

So far I have only tried changing "INTERPOL" to "RESAMPLING" in the Python script, and in the description file for mosaicking, but after the change the mosaicking tool works fine. (I'll do a batch change on all the description files and report my results when I get a chance.)

My guess is that this is all caused by some versioning mismatch: I'm using QGIS 2.18.3 (Linux Mint 17.3), where the most recent directory for SAGA descriptions is for version 2.2.3, while my SAGA version is 2.2.7.

UPDATE: I ran the following bash commands in a terminal on my machine, and this (along with the edit to SagaAlgorithm214.py) seemed to fix the problem on the SAGA tools I spot-checked:

su -i
cd /usr/share/qgis/python/plugins/processing/algs/saga/description
mv 2.2.3 2.2.3_old
mkdir 2.2.3
cd 2.2.3_old
for i in *.txt; do sed "s/|INTERPOL|/|RESAMPLING|/g" $i > ../2.2.3/$i ; done
Related Question