north-road / qgis-processing-saga-nextgen

GNU General Public License v3.0
21 stars 11 forks source link

How to use this extension #7

Open julien-nc opened 4 years ago

julien-nc commented 4 years ago

I'm sorry if I missed something. I just need some help to get this extension working.

I've compiled saga 7.2.0 on GNU/Linux, bin directory is in the path in first position. I've tried to set /path/to/saga-7.2.0 or /path/to/saga-7.2.0/bin in provider settings for SAGANG. I still can't manage to run it with processing.

What about old SAGA provider? Should it be disabled?

When things are done right, should SagaNG appear in the processing toolbox?

Is there a special way to call processing to use SagaNG?

nyalldawson commented 4 years ago

There should be nothing beyond what you've done -- after installing the plugin, you should see a new "saga next gen" algorithm group in the toolbox.

Note that the provider is much more forgiving then the core QGIS one, and the algorithms should appear regardless of whether or not the saga path is correctly set or a different version of saga is found...

julien-nc commented 4 years ago

Thanks for your answer.

Well I don't see it in QGIS 3.8 or 3.10 on Ubuntu 19.04 or 19.10.

Is there a log or something that could help me to find out where is the problem?

nyalldawson commented 4 years ago

You can check the QGIS log window by clicking the little speech bubble icon in the bottom right of the window. That's where Python and processing issues are collected.

julien-nc commented 4 years ago

Thanks for the hints. I got it working. The only effective change I made was to make SAGA 7.2.0 appear before system SAGA 7.3.0 in the PATH and make sure QGIS runs with an up-to-date environment. Whatever "saga folder" value given in processing settings did not have any effect.

Btw, SagaNG is not that forgiving because it refused the 7.3.0 installed with APT repos:

Problem with SAGA installation: unsupported SAGA version (found: 7.3.0, required: 7.2.).

Another question: Do you know if there is a major difference between Saga versions that could lead to compatibility problems? I mean, did parameter names change a lot between 2.x.x and 7.x.x?

I'm developing a QGIS plugin which uses Saga a lot. I'm wondering how sketchy it would be to "manually" call Saga with subprocess without checking which version is installed. I only use tools that are available in Saga 2.x.x so to be more explicit: Do you know if something major disappeared or changed in Saga 7.x.x?

nyalldawson commented 4 years ago

Btw, SagaNG is not that forgiving because it refused the 7.3.0 installed with APT repos:

Hm, that's an oversight. This plugin isn't supposed to care about version compatibility, I'll investigate.

Do you know if there is a major difference between Saga versions that could lead to compatibility problems? I mean, did parameter names change a lot between 2.x.x and 7.x.x?

Yes, lots.

I'm wondering how sketchy it would be to "manually" call Saga with subprocess without checking which version is installed.

This was what the SAGA plugin in qgis used to do, and the end result was a huge mess and near-continuous breakage and maintenance requests. At least in the past, SAGA would change api with every version, including minor patch releases. It's actually why QGIS gave up on trying to handle this -- after a number of individual efforts just got burnt out trying to keep things in shape, and hence the decision upstream to only support a single fixed version of SAGA.

nyalldawson commented 4 years ago

@eneiluj

What output do you see from saga_cmd -v for 7.3?

nyalldawson commented 4 years ago

(I need the exact output)

julien-nc commented 4 years ago

Yes, lots.

Damn. From my experience, nothing major changed to call "fillsinkswangliu", "upslopearea", "catchmentarea", "slopelength", "reclassifyvalues" and "kmeansclusteringforgrids". At least my results are identical if I use those with SAGA 2.3.x and 7.3.x.

The exact saga_cmd -v output is:

SAGA Version: 7.3.0

with the extra line.

Thanks for your answers!

Doctor-Who commented 4 years ago

Hi Nyall, Any chance to support 7.3.0 ? Thanks :)

nyalldawson commented 4 years ago

Looking into it...

pankus commented 4 years ago

First of all thanks a lot for this plugin... I'm on Manjaro Linux fighting with compatibility issues between QGis 3.12 and SAGA 7.5. By modifying just a line of your code (provider.py) from REQUIRED_VERSION = '7.2' to REQUIRED_VERSION = '7.5' (refer to https://gis.stackexchange.com/a/346558/5780 and comments), the plugin works flawless and I can access to the Saga algorithms form QGIS. The problem I met is that many of the raster utilities I tried do not produce any output and give the following output:

Execution completed in 0.46 seconds
Results:
{'RESULT': '/tmp/processing_ElfyfX/f77e934e78d54fd6bc26c263f4908282/RESULT.sdat'}

Loading resulting layers
The following layers were not correctly generated.<ul><li>/tmp/processing_ElfyfX/e21085af420a4fdba785ee2fd5df085f/RESULT.sdat</li><li>/tmp/processing_ElfyfX/f77e934e78d54fd6bc26c263f4908282/RESULT.sdat</li></ul>You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.

Nothing more seems to appear in QGIS logs (eventually nothing that may be related to your plugin). Is SAGA 7.5 so different than 7.2? Can you figure out what happens? The very strange behavior is that SAGA seems to run, yet there is nothing on disk at the end of the process. For Instance:

2020-03-24T18:39:25     INFO    SAGA execution commands
             grid_filter "Gaussian Filter" -INPUT "/tmp/processing_RVKNkf/2cec97ed5bd742b78f0cb5f513df75d6/base.sgrd" -SIGMA 1 -MODE 1 -RADIUS 3 -RESULT "/home/pankus/Cartografia/a_prove/TPI_test_siteLocation/prova.sdat"
2020-03-24T18:39:26     INFO    SAGA execution console output
             ____________________________

             ##### ## ##### ##
             ### ### ## ###
             ### # ## ## #### # ##
             ### ##### ## # #####
             ##### # ## ##### # ##
             ____________________________

             SAGA Version: 7.5.0

             Unknown option 'MODE'
             ____________________________
             library path: /usr/lib/saga/
             library name: libgrid_filter
             library : grid_filter
             tool : Gaussian Filter
             identifier : 1
             author : A.Ringeler (c) 2003
             processors : 8 [8]
             ____________________________

             Usage: saga_cmd grid_filter 1 [-INPUT ] [-RESULT ] [-SIGMA ] [-KERNEL_TYPE ] [-KERNEL_RADIUS ]
             -INPUT: Grid
             Grid (input)
             -RESULT: Filtered Grid
             Grid (optional output)
             -SIGMA: Standard Deviation
             Floating point
             Minimum: 0.000100
             Default: 50.000000
             -KERNEL_TYPE: Kernel Type
             Choice
             Available Choices:
             [0] Square
             [1] Circle
             Default: 1
             -KERNEL_RADIUS: Radius
             Integer
             Minimum: 0
             Default: 2
mapninja commented 3 years ago

Is there a way to point SAGANG at the SAGA version running inside the Mac Nightly build, which seems to be 7.3? I've tried just about every folder that has the word SAGA associated with it, in the app contents for the nightly, and I can't get SAGANG to show up. Will the plugin only work with SAGA external to the QGIS build?

PeterPetrik commented 3 years ago

@mapninja , need to use 0.0.4

Screenshot 2020-10-21 at 08 39 09
mapninja commented 3 years ago

Yes, updating worked. The version I grabbed last week didn't like SAGA7.3. Everything is excellent, now.

atlight commented 10 months ago

I'd like to add to this issue now that SAGA has been removed from the QGIS standard install.

I'm grateful that this plugin was created. However, the documentation is nonexistent as far as I can tell.

The plugin page contains the sentence:

Processing provider for SAGA 7.2. Requires manual installation of SAGA 7.2 binaries.

If somebody has been happily using the SAGA tools in QGIS - perhaps not even being aware that SAGA is a separate program - and then found out that the only way to keep using SAGA tools in new versions of QGIS was by installing this plugin, this information would be of little help to them. Even the word "binary" is technical jargon.

I feel there should at least be a link to where to download SAGA binaries, and a statement about why this plugin exists and how it relates to the former SAGA tools that came with QGIS out of the box.

@nyalldawson

nyalldawson commented 10 months ago

Thanks for the feedback @atlight -- this plugin is intended to be community maintained, so I'd welcome any documentation contributions or other improvements anyone wants to send in! I don't personally have the capacity to do this work myself and was hoping that a team of motivated users would ultimately take over this plugin.

benz0li commented 10 months ago

@nyalldawson Could you give a short feedback on https://github.com/qgis/QGIS/issues/51041#issuecomment-1428063359?

Regarding the plugins compatibility with newer versions of SAGA.

Thank you.

nyalldawson commented 10 months ago

@benz0li

There's no technical reason why newer saga versions won't work. It just might need updates to the description files. If you've capacity then testing and updating description files as determined would be a great contribution 👍

benz0li commented 10 months ago

If you've capacity

@nyalldawson Unfortunately I don't.