I am writing a QGIS plugin using SAGA by Processing. Is is possible to test whether SAGA is installed and which version is on?
For GDAL, it's OK with:
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
You might to want to look at some of the python code for SAGA algorithm providers, especially the module SagaUtils.py - that has a
getSagaInstalledVersion() function, and a few functions for building the paths etc.
This is an example from the Python Console:-
>>> processing.algs.saga.SagaUtils.getSagaInstalledVersion() '2.2.0'
Looking at the code, it's a wrapper around an external call to
saga_cmd -v with retry logic