Bug report #17080

Processing: saving to file results of SAGA raster tools do not work if input has a custom CRS

Added by Mario Reyes about 3 years ago. Updated over 2 years ago.

Status:Closed
Priority:Normal
Assignee:Victor Olaya
Category:Processing/SAGA
Affected QGIS version:2.18.12 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:not reproducable
Crashes QGIS or corrupts data:No Copied to github as #:24979

Description

New description:

If input layer has a custom CRS (or any CRS that is not part of QGIS library) then saving the result of a raster tool (reclassify grid values, among the others) to a specific location causes the tool to fail with an error like the one posted in #17080-6

Strangely enough if the tool is left to output to a temporary layer then it works as expected.

Old description:
When I try to save the results obtained with SAGA Reclassify values tool to a permanent file I get an error. This is the log:

Load table: C:\Users\Leslie\AppData\Local\Temp\processinga468b416737649c0918e47e806f874d2\1503849288.772.txt...

Load grid: C:\Users\Leslie\AppData\Local\Temp\processinga468b416737649c0918e47e806f874d2\b98c3d5f0201401fa5f6223495437ec8\pendientessrc.sgrd...

Load table: C:\Users\Leslie\AppData\Local\Temp\processinga468b416737649c0918e47e806f874d2\1503849288.772.txt...

Parameters

Grid system: 30.405782; 1397x 1695y; 404070.708378x 261560.209710y
Grid: pendientessrc
Reclassified Grid: Reclassified Grid
Method: simple table
Lookup Table: (columns: 3, rows: 2)
operator: min 
no data values: yes
new value: 0.000000
other values: yes
new value: 0.000000
Assign ...: NoData value of input grid

C:\PROGRA~1\QGIS2~1.18\bin>exit
Converting outputs
Cargando las capas resultantes

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

It works when the results are saved to a temporary file.

lookup_table.PNG (6.14 KB) Mario Reyes, 2017-08-27 11:19 PM

log_messages_panel.txt Magnifier (2.56 KB) Mario Reyes, 2017-09-04 04:25 AM

log.txt Magnifier (5.63 KB) Mario Reyes, 2017-10-22 05:00 PM

History

#1 Updated by Giovanni Manghi about 3 years ago

  • Status changed from Open to Feedback

Cannot confirm here (on Windows too). Please attach data and lookup table.

#2 Updated by Mario Reyes about 3 years ago

Giovanni Manghi wrote:

Cannot confirm here (on Windows too). Please attach data and lookup table.

This is the raster file: https://drive.google.com/open?id=0BxWWBxW4QOfdMXdFVE9HenZod2M
The lookup table is in the attached image.

#3 Updated by Giovanni Manghi about 3 years ago

This is the raster file: https://drive.google.com/open?id=0BxWWBxW4QOfdMXdFVE9HenZod2M

what is the CRS of this raster? regardless, here choosing the outout name and location layer instead of outputting to a temp one works as expected.

#4 Updated by Mario Reyes about 3 years ago

Giovanni Manghi wrote:

This is the raster file: https://drive.google.com/open?id=0BxWWBxW4QOfdMXdFVE9HenZod2M

what is the CRS of this raster? regardless, here choosing the outout name and location layer instead of outputting to a temp one works as expected.

I'm using a custom CRS for El Salvador:

+proj=lcc +lat_1=13.31666666666667 +lat_2=14.25 +lat_0=13.783333 +lon_0=-89 +x_0=500000 +y_0=295809.184 +k_0=0.99996704 +ellps=clrk66 +units=m +no_defs +towgs84=0,125,194,0,0,0,0 +wktext

Thanks. I tested the tool in QGIS 2.14.3 in another computer and I got the same error. I don´t know if it´s a local issue, but I have tried saving the file in different locations and got the same result. It seems it's not reproducable tough.

#5 Updated by Giovanni Manghi about 3 years ago

Thansk. I tested the tool in QGIS 2.14.3 in another computer and I got the same error. I don´t know if it´s a local issue, but I have tried saving the file in different locations and got the same result. It seems it's not reproducable tough.

try o a clean environment: (back and) remove the .qgis2 folder and clean the windows registry entries for qgis.

#6 Updated by Mario Reyes about 3 years ago

Giovanni Manghi wrote:

Thansk. I tested the tool in QGIS 2.14.3 in another computer and I got the same error. I don´t know if it´s a local issue, but I have tried saving the file in different locations and got the same result. It seems it's not reproducable tough.

try o a clean environment: (back and) remove the .qgis2 folder and clean the windows registry entries for qgis.

I unninstalled QGIS and deleted the .qgis2 folder, also deleted the keys for QGIS in the Windows Registry. I installed QGIS again and tried using a diferent CRS (not a custom CRS). The problem still persists. It's not only for this tool, but also for other SAGA tools, like Fill Sinks (Wang & Liu). I have seen these problem in at least three Windows 10 machines with the same QGIS version and earlier versions. I attach the log from the log messages panel, where these messages appear:

C:\Program Files\QGIS 2.18\bin>exit
2017-09-03T19:22:24    2    Error loading result layer:
            Traceback (most recent call last):
              File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python/plugins\processing\gui\Postprocessing.py", line 77, in handleAlgorithmResults
                isRaster)
              File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python/plugins\processing\tools\dataobjects.py", line 186, in load
                + '\nCheck the processing framework log to look for errors')
            RuntimeError: Could not load layer: C:/Users/Leslie/Documents/Curso QGIS II/Practica 2 Analisis de datos raster/datos_practica_2/test4.tif
            Check the processing framework log to look for errors

One note is that in all the machines I have tried, the operating system is in spanish, don't know if it's relevant. Thanks.

#7 Updated by Giovanni Manghi about 3 years ago

  • Description updated (diff)
  • Operating System deleted (Windows 10 32 bits)
  • Status changed from Feedback to Open
  • Subject changed from Problem saving to file results of SAGA Reclassify values tool to Processing: saving to file results of SAGA raster tools do not work if input has a custom CRS

#8 Updated by Jürgen Fischer about 3 years ago

  • Description updated (diff)

#9 Updated by Giovanni Manghi about 3 years ago

  • Status changed from Open to Feedback

Mario Reyes wrote:

Could not load layer: C:/Users/Leslie/Documents/Curso QGIS II/Practica 2 Analisis de datos raster/datos_practica_2/test4.tif

try a shorter path, with no spaces, no special chars, etc.

#10 Updated by Mario Reyes about 3 years ago

Giovanni Manghi wrote:

Mario Reyes wrote:

Could not load layer: C:/Users/Leslie/Documents/Curso QGIS II/Practica 2 Analisis de datos raster/datos_practica_2/test4.tif

try a shorter path, with no spaces, no special chars, etc.

The result is the same. I attach the log file. I used a path with your suggestions.

#11 Updated by Giovanni Manghi about 3 years ago

The result is the same. I attach the log file. I used a path with your suggestions.

RuntimeError: Could not load layer: C:/Users/Public/test.tif
Check the processing framework log to look for errors

is your username "Public"? please try a path (with no spaces and special chars) that points to the user (folder) is being used to run qgis.

#12 Updated by Giovanni Manghi over 2 years ago

  • Resolution set to not reproducable
  • Status changed from Feedback to Closed

Closing for lack of feedback, please reopen if necessary.

Also available in: Atom PDF