Bug report #16408

Problem with SAGA 2.3.1 io_gdal not loaded

Added by Pedro Venâncio over 7 years ago. Updated over 7 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:Alexander Bruy
Category:Processing/SAGA
Affected QGIS version:2.18.4 Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:duplicate
Crashes QGIS or corrupts data:No Copied to github as #:24317

Description

For some reason, SAGA 2.3.1 io_gdal module is not loaded (both on QGIS 2.18.5 and QGIS 3), and Processing SAGA algs does not work. Some examples:

Algorithm Analytical hillshading starting...
io_gdal 0 -TRANSFORM -RESAMPLING 0 -GRIDS "C:\\Users\\pedro\\AppData\\Local\\Temp\\processing46ff5fe735164762bc9e9e7d97c6ff24\\22daff45a6834eaeb2d0d54b4d822115\\SRTMPT25mclip.sgrd" -FILES "D:/SIG/MDT/SRTM_25m_JAG/SRTM_PT_25m_clip.tif" 
ta_lighting "Analytical Hillshading" -ELEVATION "C:\\Users\\pedro\\AppData\\Local\\Temp\\processing46ff5fe735164762bc9e9e7d97c6ff24\\22daff45a6834eaeb2d0d54b4d822115\\SRTMPT25mclip.sgrd" -METHOD 0 -AZIMUTH 315 -DECLINATION 45 -EXAGGERATION 4 -SHADE "C:\\Users\\pedro\\AppData\\Local\\Temp\\processing46ff5fe735164762bc9e9e7d97c6ff24\\6038b3b345b64815bcbc23e835ec164b\\SHADE.sdat" 

C:\\OSGeo4W64\\bin>set SAGA=C:/saga_2.3.1_x64

C:\\OSGeo4W64\\bin>set SAGA_MLB=C:/saga_2.3.1_x64\\modules

C:\\OSGeo4W64\\bin>PATH=C:\\OSGEO4~1\\apps\\Python36\\lib\\site-packages\
umpy\\core;C:\\OSGEO4~1\\apps\\qgis-dev\\bin;C:\\OSGEO4~1\\apps\\grass\\grass-7.2.0\\lib;C:\\OSGEO4~1\\apps\\grass\\grass-7.2.0\\bin;C:\\OSGEO4~1\\apps\\Python36;C:\\OSGEO4~1\\apps\\Python36\\Scripts;C:\\OSGEO4~1\\apps\\qt5\\bin;C:\\OSGEO4~1\\apps\\Python27\\Scripts;C:\\OSGEO4~1\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\WBem;C:\\OSGEO4~1\\apps\\msys\\bin;C:/saga_2.3.1_x64;C:/saga_2.3.1_x64\\modules

C:\\OSGeo4W64\\bin>saga_cmd io_gdal 0 -TRANSFORM -RESAMPLING 0 -GRIDS "C:\\Users\\pedro\\AppData\\Local\\Temp\\processing46ff5fe735164762bc9e9e7d97c6ff24\\22daff45a6834eaeb2d0d54b4d822115\\SRTMPT25mclip.sgrd" -FILES "D:/SIG/MDT/SRTM_25m_JAG/SRTM_PT_25m_clip.tif" 
____________________________

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

SAGA Version: 2.3.1 (64 bit)

77 loaded tool libraries (670 tools):
- climate
- climate_tools
- contrib_perego
- db_odbc
- db_pgsql
- docs_html
- docs_pdf
- garden_3d_viewer
- garden_fractals
- garden_games
- garden_learn_to_program
- garden_webservices
- grid_analysis
- grid_calculus
- grid_calculus_bsl
- grid_filter
- grid_gridding
- grid_spline
- grid_tools
- grid_visualisation
- imagery
- imagery_classification
- imagery_isocluster
- imagery_maxent
- imagery_opencv
- imagery_photogrammetry
- imagery_segmentation
- imagery_svm
- imagery_tools
- imagery_vigra
- io_esri_e00
- io_gps
- io_grid
- io_grid_image
- io_shapes
- io_shapes_dxf
- io_shapes_las
- io_table
- io_virtual
- pj_georeference
- pj_geotrans
- pj_proj4
- pointcloud_tools
- pointcloud_viewer
- shapes_grid
- shapes_lines
- shapes_points
- shapes_polygons
- shapes_tools
- shapes_transect
- sim_cellular_automata
- sim_ecosystems_hugget
- sim_erosion
- sim_fire_spreading
- sim_hydrology
- sim_ihacres
- sim_qm_of_esp
- sim_rivflow
- statistics_grid
- statistics_kriging
- statistics_points
- statistics_regression
- ta_channels
- ta_compound
- ta_hydrology
- ta_lighting
- ta_morphometry
- ta_preprocessor
- ta_profiles
- ta_slope_stability
- table_calculus
- table_tools
- terrain_analysis
- tin_tools
- tin_viewer
- toolchains
- tta_tools

type -h or --help for further information

Error: select a library

C:\\OSGeo4W64\\bin>saga_cmd ta_lighting "Analytical Hillshading" -ELEVATION "C:\\Users\\pedro\\AppData\\Local\\Temp\\processing46ff5fe735164762bc9e9e7d97c6ff24\\22daff45a6834eaeb2d0d54b4d822115\\SRTMPT25mclip.sgrd" -METHOD 0 -AZIMUTH 315 -DECLINATION 45 -EXAGGERATION 4 -SHADE "C:\\Users\\pedro\\AppData\\Local\\Temp\\processing46ff5fe735164762bc9e9e7d97c6ff24\\6038b3b345b64815bcbc23e835ec164b\\SHADE.sdat" 
____________________________

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

SAGA Version: 2.3.1 (64 bit)

____________________________
library path: C:\\saga_2.3.1_x64\\modules\\
library name: ta_lighting
library : Lighting, Visibility
tool : Analytical Hillshading
author : O.Conrad, V.Wichmann (c) 2003-2013
processors : 4 [4]
____________________________

Load grid: C:\\Users\\pedro\\AppData\\Local\\Temp\\processing46ff5fe735164762bc9e9e7d97c6ff24\\22daff45a6834eaeb2d0d54b4d822115\\SRTMPT25mclip.sgrd...
failed

Usage: saga_cmd ta_lighting 0 [-ELEVATION ] [-SHADE ] [-METHOD ] [-AZIMUTH ] [-DECLINATION ] [-EXAGGERATION ] [-SHADOW ] [-NDIRS ] [-RADIUS ]
-ELEVATION: Elevation
Grid (input)
-SHADE: Analytical Hillshading
Grid (output)
-METHOD: Shading Method
Choice
Available Choices:
[0] Standard
[1] Standard (max. 90Degree)
[2] Combined Shading
[3] Ray Tracing
[4] Ambient Occlusion
Default: 0
-AZIMUTH: Azimuth [Degree]
Floating point
Default: 315.000000
-DECLINATION: Height [Degree]
Floating point
Default: 45.000000
-EXAGGERATION: Exaggeration
Floating point
Default: 4.000000
-SHADOW: Shadow
Choice
Available Choices:
[0] slim
[1] fat
Default: 1
-NDIRS: Number of Directions
Integer
Minimum: 2
Default: 8
-RADIUS: Search Radius
Floating point
Minimum: 0.001000
Default: 10.000000
Error: input file [C:\\Users\\pedro\\AppData\\Local\\Temp\\processing46ff5fe735164762bc9e9e7d97c6ff24\\22daff45a6834eaeb2d0d54b4d822115\\SRTMPT25mclip.sgrd]
Error: Elevation

C:\\OSGeo4W64\\bin>exit
Converting outputs

'NoneType' object has no attribute 'crs' See log for more details
2017-04-03T11:30:03    0    SAGA execution commands
            io_gdal 0 -TRANSFORM 1 -RESAMPLING 0 -GRIDS "C:\\Users\\pedro\\AppData\\Local\\Temp\\processing8edb67c56c2f40fdbdb571c8abd10840\\f85d24e433ae4d70a0f056249cd78bbd\\baciaslee2014201817Binarytiff.sgrd" -FILES "D:/SIG/CRIF2010/POM_2017/LEE_2017/bacias_lee_2014_2018_17_Binary.tiff" 
            grid_calculus "Grid Calculator"  -GRIDS "C:\\Users\\pedro\\AppData\\Local\\Temp\\processing8edb67c56c2f40fdbdb571c8abd10840\\f85d24e433ae4d70a0f056249cd78bbd\\baciaslee2014201817Binarytiff.sgrd" -FORMULA "int(a)" -USE_NODATA false -TYPE 5 -RESULT "C:\\Users\\pedro\\AppData\\Local\\Temp\\processing8edb67c56c2f40fdbdb571c8abd10840\\0a6500bac81a4dd3ba613aba5777b8ce\\RESULT.sdat" 
2017-04-03T11:30:18    0    SAGA execution console output

            C:\\OSGeo4W64\\bin>set SAGA=C:\\saga_2.3.1_x64

            C:\\OSGeo4W64\\bin>set SAGA_MLB=C:\\saga_2.3.1_x64\\modules

            C:\\OSGeo4W64\\bin>PATH=C:\\OSGEO4~1\\apps\\Python27\\lib\\site-packages\\Shapely-1.2.18-py2.7-win-amd64.egg\\shapely\\DLLs;C:\\OSGEO4~1\\apps\\Python27\\DLLs;C:\\OSGEO4~1\\apps\\Python27\\lib\\site-packages\
umpy\\core;C:\\OSGEO4~1\\apps\\qgis-rel-dev\\bin;C:\\OSGEO4~1\\apps\\grass\\grass-7.2.0\\lib;C:\\OSGEO4~1\\apps\\grass\\grass-7.2.0\\bin;C:\\OSGEO4~1\\apps\\Python27\\Scripts;C:\\OSGEO4~1\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\WBem;C:\\OSGEO4~1\\apps\\msys\\bin;C:\\saga_2.3.1_x64;C:\\saga_2.3.1_x64\\modules

            C:\\OSGeo4W64\\bin>saga_cmd io_gdal 0 -TRANSFORM 1 -RESAMPLING 0 -GRIDS "C:\\Users\\pedro\\AppData\\Local\\Temp\\processing8edb67c56c2f40fdbdb571c8abd10840\\f85d24e433ae4d70a0f056249cd78bbd\\baciaslee2014201817Binarytiff.sgrd" -FILES "D:/SIG/CRIF2010/POM_2017/LEE_2017/bacias_lee_2014_2018_17_Binary.tiff" 
            ____________________________

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

            SAGA Version: 2.3.1 (64 bit)

            77 loaded tool libraries (670 tools):
            - climate
            - climate_tools
            - contrib_perego
            - db_odbc
            - db_pgsql
            - docs_html
            - docs_pdf
            - garden_3d_viewer
            - garden_fractals
            - garden_games
            - garden_learn_to_program
            - garden_webservices
            - grid_analysis
            - grid_calculus
            - grid_calculus_bsl
            - grid_filter
            - grid_gridding
            - grid_spline
            - grid_tools
            - grid_visualisation
            - imagery
            - imagery_classification
            - imagery_isocluster
            - imagery_maxent
            - imagery_opencv
            - imagery_photogrammetry
            - imagery_segmentation
            - imagery_svm
            - imagery_tools
            - imagery_vigra
            - io_esri_e00
            - io_gps
            - io_grid
            - io_grid_image
            - io_shapes
            - io_shapes_dxf
            - io_shapes_las
            - io_table
            - io_virtual
            - pj_georeference
            - pj_geotrans
            - pj_proj4
            - pointcloud_tools
            - pointcloud_viewer
            - shapes_grid
            - shapes_lines
            - shapes_points
            - shapes_polygons
            - shapes_tools
            - shapes_transect
            - sim_cellular_automata
            - sim_ecosystems_hugget
            - sim_erosion
            - sim_fire_spreading
            - sim_hydrology
            - sim_ihacres
            - sim_qm_of_esp
            - sim_rivflow
            - statistics_grid
            - statistics_kriging
            - statistics_points
            - statistics_regression
            - ta_channels
            - ta_compound
            - ta_hydrology
            - ta_lighting
            - ta_morphometry
            - ta_preprocessor
            - ta_profiles
            - ta_slope_stability
            - table_calculus
            - table_tools
            - terrain_analysis
            - tin_tools
            - tin_viewer
            - toolchains
            - tta_tools

            type -h or --help for further information

            Error: select a library

            C:\\OSGeo4W64\\bin>saga_cmd grid_calculus "Grid Calculator"  -GRIDS "C:\\Users\\pedro\\AppData\\Local\\Temp\\processing8edb67c56c2f40fdbdb571c8abd10840\\f85d24e433ae4d70a0f056249cd78bbd\\baciaslee2014201817Binarytiff.sgrd" -FORMULA "int(a)" -USE_NODATA false -TYPE 5 -RESULT "C:\\Users\\pedro\\AppData\\Local\\Temp\\processing8edb67c56c2f40fdbdb571c8abd10840\\0a6500bac81a4dd3ba613aba5777b8ce\\RESULT.sdat" 
            ____________________________

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

            SAGA Version: 2.3.1 (64 bit)

            ____________________________
            library path: C:\\saga_2.3.1_x64\\modules\\
            library name: grid_calculus
            library     : Calculus
            tool        : Grid Calculator
            author      : A.Ringeler (c) 2003
            processors  : 4 [4]
            ____________________________

            Load grid: C:\\Users\\pedro\\AppData\\Local\\Temp\\processing8edb67c56c2f40fdbdb571c8abd10840\\f85d24e433ae4d70a0f056249cd78bbd\\baciaslee2014201817Binarytiff.sgrd...
            failed
            Grid Calculator: could not initialize data objects
            Error: executing tool [Grid Calculator]

            C:\\OSGeo4W64\\bin>exit
2017-04-03T11:30:18    2    Error loading result layer:
            Traceback (most recent call last):
              File "C:/OSGEO4~1/apps/qgis-rel-dev/./python/plugins\\processing\\gui\\Postprocessing.py", line 75, in handleAlgorithmResults
                out.name))
              File "C:/OSGEO4~1/apps/qgis-rel-dev/./python/plugins\\processing\\tools\\dataobjects.py", line 199, in load
                + '\
Check the processing framework log to look for errors')
            RuntimeError: Could not load layer: C:\\Users\\pedro\\AppData\\Local\\Temp\\processing8edb67c56c2f40fdbdb571c8abd10840\\0a6500bac81a4dd3ba613aba5777b8ce\\RESULT.sdat
            Check the processing framework log to look for errors

With OSGeo4W Shell I get:

C:\\OSGeo4W64\\bin>set SAGA=C:/saga_2.3.1_x64

C:\\OSGeo4W64\\bin>set SAGA_MLB=C:/saga_2.3.1_x64\\modules

C:\\OSGeo4W64\\bin>PATH=C:\\OSGEO4~1\\apps\\Python36\\lib\\site-packages\
umpy\\core;C:\\OSGEO4~1\\apps\\qgis-dev\\bin;C:\\OSGEO4~1\\apps\\grass\\grass-7.2.0\\lib;C:\\OSGEO4~1\\apps\\grass\\grass-7.2.0\\bin;C:\\OSGEO4~1\\apps\\Python36;C:\\OSGEO4~1\\apps\\Python36\\Scripts;C:\\OSGEO4~1\\apps\\qt5\\bin;C:\\OSGEO4~1\\apps\\Python27\\Scripts;C:\\OSGEO4~1\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\WBem;C:\\OSGEO4~1\\apps\\msys\\bin;C:/saga_2.3.1_x64;C:/saga_2.3.1_x64\\modules

C:\\OSGeo4W64\\bin>saga_cmd io_gdal
____________________________

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

SAGA Version: 2.3.1 (64 bit)

77 loaded tool libraries (670 tools):
- climate
- climate_tools
- contrib_perego
- db_odbc
- db_pgsql
- docs_html
- docs_pdf
- garden_3d_viewer
- garden_fractals
- garden_games
- garden_learn_to_program
- garden_webservices
- grid_analysis
- grid_calculus
- grid_calculus_bsl
- grid_filter
- grid_gridding
- grid_spline
- grid_tools
- grid_visualisation
- imagery
- imagery_classification
- imagery_isocluster
- imagery_maxent
- imagery_opencv
- imagery_photogrammetry
- imagery_segmentation
- imagery_svm
- imagery_tools
- imagery_vigra
- io_esri_e00
- io_gps
- io_grid
- io_grid_image
- io_shapes
- io_shapes_dxf
- io_shapes_las
- io_table
- io_virtual
- pj_georeference
- pj_geotrans
- pj_proj4
- pointcloud_tools
- pointcloud_viewer
- shapes_grid
- shapes_lines
- shapes_points
- shapes_polygons
- shapes_tools
- shapes_transect
- sim_cellular_automata
- sim_ecosystems_hugget
- sim_erosion
- sim_fire_spreading
- sim_hydrology
- sim_ihacres
- sim_qm_of_esp
- sim_rivflow
- statistics_grid
- statistics_kriging
- statistics_points
- statistics_regression
- ta_channels
- ta_compound
- ta_hydrology
- ta_lighting
- ta_morphometry
- ta_preprocessor
- ta_profiles
- ta_slope_stability
- table_calculus
- table_tools
- terrain_analysis
- tin_tools
- tin_viewer
- toolchains
- tta_tools

type -h or --help for further information

Running saga_cmd directly from the folder I get:

C:\\saga_2.3.1_x64>saga_cmd
____________________________

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

SAGA Version: 2.3.1 (64 bit)

78 loaded tool libraries (680 tools):
- climate
- climate_tools
- contrib_perego
- db_odbc
- db_pgsql
- docs_html
- docs_pdf
- garden_3d_viewer
- garden_fractals
- garden_games
- garden_learn_to_program
- garden_webservices
- grid_analysis
- grid_calculus
- grid_calculus_bsl
- grid_filter
- grid_gridding
- grid_spline
- grid_tools
- grid_visualisation
- imagery
- imagery_classification
- imagery_isocluster
- imagery_maxent
- imagery_opencv
- imagery_photogrammetry
- imagery_segmentation
- imagery_svm
- imagery_tools
- imagery_vigra
- io_esri_e00
- io_gdal
- io_gps
- io_grid
- io_grid_image
- io_shapes
- io_shapes_dxf
- io_shapes_las
- io_table
- io_virtual
- pj_georeference
- pj_geotrans
- pj_proj4
- pointcloud_tools
- pointcloud_viewer
- shapes_grid
- shapes_lines
- shapes_points
- shapes_polygons
- shapes_tools
- shapes_transect
- sim_cellular_automata
- sim_ecosystems_hugget
- sim_erosion
- sim_fire_spreading
- sim_hydrology
- sim_ihacres
- sim_qm_of_esp
- sim_rivflow
- statistics_grid
- statistics_kriging
- statistics_points
- statistics_regression
- ta_channels
- ta_compound
- ta_hydrology
- ta_lighting
- ta_morphometry
- ta_preprocessor
- ta_profiles
- ta_slope_stability
- table_calculus
- table_tools
- terrain_analysis
- tin_tools
- tin_viewer
- toolchains
- tta_tools

Error: select a library
type -h or --help for further information
C:\\saga_2.3.1_x64>saga_cmd io_gdal
____________________________

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

SAGA Version: 2.3.1 (64 bit)

Library:    GDAL/OGR
Category:   Import/Export
File:   C:\\saga_2.3.1_x64\\modules\\io_gdal.dll

Tools:
0    Import Raster
1    Export Raster
2    Export GeoTIFF
3    Import Shapes
4    Export Shapes
5    Export Shapes to KML
6    Import NetCDF
7    Create Raster Catalog from Files
8    Create Raster Catalog from Directory
9    Import TMS Image

Error: select a tool
type -h or --help for further information

History

#1 Updated by Giovanni Manghi over 7 years ago

  • Priority changed from High to Severe/Regression

This is critical to be solved before 2.18 ships as new LTR.

#2 Updated by Jürgen Fischer over 7 years ago

Does that also happen with OSGeo4W's saga-ltr?

#3 Updated by Pedro Venâncio over 7 years ago

A different problem with OSGeo4W's saga-ltr, Jurgen:

Unexpected parameter '0'

Algorithm Raster calculator starting...
io_gdal 0 -TRANSFORM -INTERPOL 0 -GRIDS "C:\\Users\\pedro\\AppData\\Local\\Temp\\processing9f5e24d6e7234d1f96bc0c51710e11cd\\246df25cfcbd420fbfd46f0a0f59cc7c\\baciaslee2014201817Binary.sgrd" -FILES "D:\\SIG\\CRIF2010\\POM_2017\\LEE_2017\\bacias_lee_2014_2018_17_Binary.tif" 
grid_calculus "Grid Calculator" -GRIDS "C:\\Users\\pedro\\AppData\\Local\\Temp\\processing9f5e24d6e7234d1f96bc0c51710e11cd\\246df25cfcbd420fbfd46f0a0f59cc7c\\baciaslee2014201817Binary.sgrd" -FORMULA "int(a)" -TYPE 5 -RESULT "C:\\Users\\pedro\\AppData\\Local\\Temp\\processing9f5e24d6e7234d1f96bc0c51710e11cd\\beff0bb51d65463a805800f4efc946c8\\RESULT.sdat" 

C:\\OSGeo4W64\\bin>set SAGA=C:\\OSGeo4W64\\apps\\saga-ltr

C:\\OSGeo4W64\\bin>set SAGA_MLB=C:\\OSGeo4W64\\apps\\saga-ltr\\modules

C:\\OSGeo4W64\\bin>PATH=C:\\OSGEO4~1\\apps\\Python27\\lib\\site-packages\\Shapely-1.2.18-py2.7-win-amd64.egg\\shapely\\DLLs;C:\\OSGEO4~1\\apps\\Python27\\DLLs;C:\\OSGEO4~1\\apps\\Python27\\lib\\site-packages\
umpy\\core;C:\\OSGEO4~1\\apps\\qgis-rel-dev\\bin;C:\\OSGEO4~1\\apps\\grass\\grass-7.2.0\\lib;C:\\OSGEO4~1\\apps\\grass\\grass-7.2.0\\bin;C:\\OSGEO4~1\\apps\\Python27\\Scripts;C:\\OSGEO4~1\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\WBem;C:\\OSGEO4~1\\apps\\msys\\bin;C:\\OSGeo4W64\\apps\\saga-ltr;C:\\OSGeo4W64\\apps\\saga-ltr\\modules

C:\\OSGeo4W64\\bin>saga_cmd io_gdal 0 -TRANSFORM -INTERPOL 0 -GRIDS "C:\\Users\\pedro\\AppData\\Local\\Temp\\processing9f5e24d6e7234d1f96bc0c51710e11cd\\246df25cfcbd420fbfd46f0a0f59cc7c\\baciaslee2014201817Binary.sgrd" -FILES "D:\\SIG\\CRIF2010\\POM_2017\\LEE_2017\\bacias_lee_2014_2018_17_Binary.tif" 
Unexpected parameter '0'
____________________________

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

SAGA Version: 2.3.2 (64 bit)

____________________________
library path: C:\\OSGeo4W64\\apps\\saga-ltr\\modules\\
library name: io_gdal
library : GDAL/OGR
tool : Import Raster
author : O.Conrad (c) 2007 (A.Ringeler)
processors : 4 [4]
____________________________

Usage: saga_cmd io_gdal 0 [-GRIDS ] [-FILES ] [-SELECTION ] [-SELECT_SORT ] [-TRANSFORM ] [-RESAMPLING ]
-GRIDS: Grids
Grid list (output)
-FILES: Files
File path
-SELECTION: Select from Multiple Bands
Text
-SELECT_SORT: Alphanumeric Sorting
Boolean
Default: 1
-TRANSFORM: Transformation
Boolean
Default: 1
-RESAMPLING: Resampling
Choice
Available Choices:
[0] Nearest Neighbour
[1] Bilinear Interpolation
[2] Bicubic Spline Interpolation
[3] B-Spline Interpolation
Default: 3

C:\\OSGeo4W64\\bin>saga_cmd grid_calculus "Grid Calculator" -GRIDS "C:\\Users\\pedro\\AppData\\Local\\Temp\\processing9f5e24d6e7234d1f96bc0c51710e11cd\\246df25cfcbd420fbfd46f0a0f59cc7c\\baciaslee2014201817Binary.sgrd" -FORMULA "int(a)" -TYPE 5 -RESULT "C:\\Users\\pedro\\AppData\\Local\\Temp\\processing9f5e24d6e7234d1f96bc0c51710e11cd\\beff0bb51d65463a805800f4efc946c8\\RESULT.sdat" 
____________________________

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

SAGA Version: 2.3.2 (64 bit)

____________________________
library path: C:\\OSGeo4W64\\apps\\saga-ltr\\modules\\
library name: grid_calculus
library : Calculus
tool : Grid Calculator
author : A.Ringeler (c) 2003
processors : 4 [4]
____________________________

Load grid: C:\\Users\\pedro\\AppData\\Local\\Temp\\processing9f5e24d6e7234d1f96bc0c51710e11cd\\246df25cfcbd420fbfd46f0a0f59cc7c\\baciaslee2014201817Binary.sgrd...
failed
Grid Calculator: could not initialize data objects
Error: executing tool [Grid Calculator]

C:\\OSGeo4W64\\bin>exit
Converting outputs
Loading resulting layers

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

#4 Updated by Pedro Venâncio over 7 years ago

Sorry, tested 2.18.5 before close all QGIS projets. So with QGIS 2.18.5 and SAGA 2.3.2 (osgeo4w saga-ltr) everything seems to work ok.

With QGIS 3:

Algorithm Raster calculator starting...
io_gdal 0 -TRANSFORM -RESAMPLING 0 -GRIDS "C:\\Users\\pedro\\AppData\\Local\\Temp\\processingb6b8add68afd4ac9acdff98353efb6b7\\e43b1f2c4cb440f28e8cd8cb2d0f0872\\SRTMPT25mclip.sgrd" -FILES "D:/SIG/MDT/SRTM_25m_JAG/SRTM_PT_25m_clip.tif" 
grid_calculus "Grid Calculator" -GRIDS "C:\\Users\\pedro\\AppData\\Local\\Temp\\processingb6b8add68afd4ac9acdff98353efb6b7\\e43b1f2c4cb440f28e8cd8cb2d0f0872\\SRTMPT25mclip.sgrd" -FORMULA "a*2" -TYPE 7 -RESULT "C:\\Users\\pedro\\AppData\\Local\\Temp\\processingb6b8add68afd4ac9acdff98353efb6b7\\9acc2bbc236d4153997a498172525417\\RESULT.sdat" 

C:\\OSGeo4W64\\bin>set SAGA=C:/OSGeo4W64/apps/saga-ltr

C:\\OSGeo4W64\\bin>set SAGA_MLB=C:/OSGeo4W64/apps/saga-ltr\\modules

C:\\OSGeo4W64\\bin>PATH=C:\\OSGEO4~1\\apps\\Python36\\lib\\site-packages\
umpy\\core;C:\\OSGEO4~1\\apps\\qgis-dev\\bin;C:\\OSGEO4~1\\apps\\grass\\grass-7.2.0\\lib;C:\\OSGEO4~1\\apps\\grass\\grass-7.2.0\\bin;C:\\OSGEO4~1\\apps\\Python36;C:\\OSGEO4~1\\apps\\Python36\\Scripts;C:\\OSGEO4~1\\apps\\qt5\\bin;C:\\OSGEO4~1\\apps\\Python27\\Scripts;C:\\OSGEO4~1\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\WBem;C:\\OSGEO4~1\\apps\\msys\\bin;C:/OSGeo4W64/apps/saga-ltr;C:/OSGeo4W64/apps/saga-ltr\\modules

C:\\OSGeo4W64\\bin>saga_cmd io_gdal 0 -TRANSFORM -RESAMPLING 0 -GRIDS "C:\\Users\\pedro\\AppData\\Local\\Temp\\processingb6b8add68afd4ac9acdff98353efb6b7\\e43b1f2c4cb440f28e8cd8cb2d0f0872\\SRTMPT25mclip.sgrd" -FILES "D:/SIG/MDT/SRTM_25m_JAG/SRTM_PT_25m_clip.tif" 
Unexpected parameter '0'
____________________________

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

SAGA Version: 2.3.2 (64 bit)

____________________________
library path: C:\\OSGeo4W64\\apps\\saga-ltr\\modules\\
library name: io_gdal
library : GDAL/OGR
tool : Import Raster
author : O.Conrad (c) 2007 (A.Ringeler)
processors : 4 [4]
____________________________

Usage: saga_cmd io_gdal 0 [-GRIDS ] [-FILES ] [-SELECTION ] [-SELECT_SORT ] [-TRANSFORM ] [-RESAMPLING ]
-GRIDS: Grids
Grid list (output)
-FILES: Files
File path
-SELECTION: Select from Multiple Bands
Text
-SELECT_SORT: Alphanumeric Sorting
Boolean
Default: 1
-TRANSFORM: Transformation
Boolean
Default: 1
-RESAMPLING: Resampling
Choice
Available Choices:
[0] Nearest Neighbour
[1] Bilinear Interpolation
[2] Bicubic Spline Interpolation
[3] B-Spline Interpolation
Default: 3

C:\\OSGeo4W64\\bin>saga_cmd grid_calculus "Grid Calculator" -GRIDS "C:\\Users\\pedro\\AppData\\Local\\Temp\\processingb6b8add68afd4ac9acdff98353efb6b7\\e43b1f2c4cb440f28e8cd8cb2d0f0872\\SRTMPT25mclip.sgrd" -FORMULA "a*2" -TYPE 7 -RESULT "C:\\Users\\pedro\\AppData\\Local\\Temp\\processingb6b8add68afd4ac9acdff98353efb6b7\\9acc2bbc236d4153997a498172525417\\RESULT.sdat" 
____________________________

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

SAGA Version: 2.3.2 (64 bit)

____________________________
library path: C:\\OSGeo4W64\\apps\\saga-ltr\\modules\\
library name: grid_calculus
library : Calculus
tool : Grid Calculator
author : A.Ringeler (c) 2003
processors : 4 [4]
____________________________

Load grid: C:\\Users\\pedro\\AppData\\Local\\Temp\\processingb6b8add68afd4ac9acdff98353efb6b7\\e43b1f2c4cb440f28e8cd8cb2d0f0872\\SRTMPT25mclip.sgrd...
failed
Grid Calculator: could not initialize data objects
Error: executing tool [Grid Calculator]

C:\\OSGeo4W64\\bin>exit
Converting outputs

'NoneType' object has no attribute 'crs' See log for more details

I think the problem is on

https://github.com/qgis/QGIS/blob/master/python/plugins/processing/algs/saga/SagaAlgorithm.py#L328

return 'io_gdal 0 -TRANSFORM -RESAMPLING 0 -GRIDS "' + destFilename + '" -FILES "' + source + '"'

should be

return 'io_gdal 0 -TRANSFORM 1 -RESAMPLING 0 -GRIDS "' + destFilename + '" -FILES "' + source + '"'

#5 Updated by Pedro Venâncio over 7 years ago

Besides the error in https://github.com/qgis/QGIS/blob/master/python/plugins/processing/algs/saga/SagaAlgorithm.py#L328

I've found something strange, that can be tested running SAGA - Raster Calculator, with SAGA-LTR (from OSGeo4W) and

Sample file: https://cld.pt/dl/download/6ac21f8c-0244-45a5-823e-6047bb99b208/bacias_lee_2014_2018_17_Binary.tif
Formula: int(a)
Use NoData: no
Data Type: [5] unsigned 4 byte integer

The purpose of this exercise is to pass the original raster to integer. When I do this in SAGA 2.3.2, pixels with a value of 1 go to nodata.

Using SAGA 2.3.2 GUI, I get the correct result (value 1). Same with SAGA 2.1.2.

The problem is related to the import (io_gdal).

After some tests,

- On Linux, with SAGA 2.3.1, it works well;

- On Windows, with SAGA 2.1.2, it works well;

- On Windows, with SAGA 2.3.2 GUI, it works well;

- On Windows, with SAGA 2.3.2, the import:

saga_cmd io_gdal 0 -TRANSFORM 1 -RESAMPLING 0 -GRIDS "C:\\Users\\PedroVenancio\\qgis\\baciaslee2014201817Binary.sgrd" -FILES "C:\\Users\\PedroVenancio\\qgis\\bacias_lee_2014_2018_17_Binary.tif" 

passes the pixels with value 1 to nodata, both on QGIS and on osgeo4w shell.

- On Windows, with SAGA 2.3.1 from https://sourceforge.net/projects/saga-gis/files/SAGA%20-%202.3/, it works well on cli. This version, through QGIS, gives the problem of not loading the io_gdal module that I reported above.

#6 Updated by Victor Olaya over 7 years ago

Looks like there was an issue in the syntax supported. It wasnt correctl using 2.3.x syntax in QGIS 3. I just fied it, so QGIS 3 should work fine with the saga-ltr shipped in osgeo4w

#7 Updated by Giovanni Manghi over 7 years ago

  • Resolution set to duplicate
  • Status changed from Open to Closed

For sake of clarity this has been replaced by #16423, #16422 and #16421

Also available in: Atom PDF