Saturday 2 March 2019

qgis - Error in catchment area calculation


I downloaded a DEM based on the ASTER Global Digital Elevation Model (resolution 30 m; ASTGTM2_N42W009_dem.tif) from the Earth Explorer website (https://earthexplorer.usgs.gov/). I am trying to calculate the catchment area in QGIS 2.18.10 with the SAGA (version 2.3.2) geoalgorithm "Catchment Area" available in QGIS toolbox. However, when I apply the algorithm, I get the following error (in bold):



The following layers were not correctly generated.


Catchment Area


You can check the log messages to find more information about the execution of the algorithm


Several SAGA algorithms yield the same error, while others work well apparently such as "clip raster with a polygon". I have been looking in the internet for potential solutions and I think it may be a mismatch between the QGIS and SAGA versions. I am running QGIS in Windows. Find below the log message that I obtain after running the "Catchment Area" algorithm:


Algorithm Catchment area starting...
ta_hydrology "Flow Accumulation (Top-Down)" -ELEVATION "C:\Users\Andre\AppData\Local\Temp\processingd042cd5855714f1aa9738be490723d02\22c5c81d5cb14560a14a1139b0c46106\ASTGTM2N42W009dem30m.sgrd" -METHOD 0 -CAREA "C:\Users\Andre\AppData\Local\Temp\processingd042cd5855714f1aa9738be490723d02\c9f6dd80b5f0406ba2b3170a06d7a314\CAREA.sdat"

C:\PROGRA~1\QGIS2~1.18\bin>set SAGA=C:/PROGRA~1/QGIS2~1.18/apps\saga-ltr

C:\PROGRA~1\QGIS2~1.18\bin>set SAGA_MLB=C:/PROGRA~1/QGIS2~1.18/apps\saga-ltr\modules


C:\PROGRA~1\QGIS2~1.18\bin>PATH=C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win-amd64.egg\shapely\DLLs;C:\PROGRA~1\QGIS2~1.18\apps\Python27\DLLs;C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\numpy\core;C:\PROGRA~1\QGIS2~1.18\apps\qgis\bin;C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.1\lib;C:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.2.1\bin;{app};C:\PROGRA~1\QGIS2~1.18\apps\Python27\Scripts;C:\PROGRA~1\QGIS2~1.18\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBem;C:\Program Files\R\R-3.4.0\bin\x64;C:\Program Files\RStudio\bin;C:/PROGRA~1/QGIS2~1.18/apps\saga-ltr;C:/PROGRA~1/QGIS2~1.18/apps\saga-ltr\modules

C:\PROGRA~1\QGIS2~1.18\bin>saga_cmd ta_hydrology "Flow Accumulation (Top-Down)" -ELEVATION "C:\Users\Andre\AppData\Local\Temp\processingd042cd5855714f1aa9738be490723d02\22c5c81d5cb14560a14a1139b0c46106\ASTGTM2N42W009dem30m.sgrd" -METHOD 0 -CAREA "C:\Users\Andre\AppData\Local\Temp\processingd042cd5855714f1aa9738be490723d02\c9f6dd80b5f0406ba2b3170a06d7a314\CAREA.sdat"
Unknown option 'CAREA'
____________________________

##### ## ##### ##
### ### ## ###
### # ## ## #### # ##

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

SAGA Version: 2.3.2 (64 bit)

____________________________
library path: C:\PROGRA~1\QGIS2~1.18\apps\saga-ltr\modules\
library name: ta_hydrology
library : Hydrology

tool : Flow Accumulation (Top-Down)
author : O.Conrad (c) 2001-2016, T.Grabs portions (c) 2010
processors : 4 [4]
____________________________


Usage: saga_cmd ta_hydrology 0 [-ELEVATION ] [-SINKROUTE ] [-WEIGHTS ] [-FLOW ] [-VAL_INPUT ] [-VAL_MEAN ] [-ACCU_MATERIAL ] [-ACCU_TARGET ] [-ACCU_TOTAL ] [-ACCU_LEFT ] [-ACCU_RIGHT ] [-STEP ] [-FLOW_UNIT ] [-FLOW_LENGTH ] [-LINEAR_VAL ] [-LINEAR_DIR ] [-METHOD ] [-LINEAR_DO ] [-LINEAR_MIN ] [-CONVERGENCE ] [-NO_NEGATIVES ] [-WEIGHT_LOSS ]
-ELEVATION: Elevation
Grid (input)
-SINKROUTE: Sink Routes

Grid (optional input)
-WEIGHTS: Weights
Grid (optional input)
-FLOW: Flow Accumulation
Grid (output)
-VAL_INPUT: Input for Mean over Catchment
Grid (optional input)
-VAL_MEAN: Mean over Catchment
Grid (output)
-ACCU_MATERIAL: Material for Accumulation

Grid (optional input)
-ACCU_TARGET: Accumulation Target
Grid (input)
-ACCU_TOTAL: Accumulated Material
Grid (optional output)
-ACCU_LEFT: Accumulated Material (Left Side)
Grid (optional output)
-ACCU_RIGHT: Accumulated Material (Right Side)
Grid (optional output)
-STEP: Step

Integer
Minimum: 1
Default: 1
-FLOW_UNIT: Flow Accumulation Unit
Choice
Available Choices:
[0] number of cells
[1] cell area
Default: 1
-FLOW_LENGTH: Flow Path Length

Grid (optional output)
-LINEAR_VAL: Linear Flow Threshold Grid
Grid (optional input)
-LINEAR_DIR: Channel Direction
Grid (optional input)
-METHOD: Method
Choice
Available Choices:
[0] Deterministic 8
[1] Rho 8

[2] Braunschweiger Reliefmodell
[3] Deterministic Infinity
[4] Multiple Flow Direction
[5] Multiple Triangular Flow Directon
[6] Multiple Maximum Downslope Gradient Based Flow Directon
Default: 4
-LINEAR_DO: Thresholded Linear Flow
Boolean
Default: 0
-LINEAR_MIN: Linear Flow Threshold

Integer
Default: 500
-CONVERGENCE: Convergence
Floating point
Minimum: 0.000000
Default: 1.100000
-NO_NEGATIVES: Prevent Negative Flow Accumulation
Boolean
Default: 1
-WEIGHT_LOSS: Loss through Negative Weights

Grid (optional output)

C:\PROGRA~1\QGIS2~1.18\bin>exit
Converting outputs
Loading resulting layers

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


EDIT: Following Kazuhito's comment, I installed SAGA 2.1.4 and the algorithm produced a raster layer. However, I am not sure if the algorithm ran properly because during the process, some errors were identified because the algorithm was not finding specific libraries. Despite this, I installed the most recent release of QGIS (2.18.13), which has incorporated SAGA 2.3.2, and apparently the algorithm "Catchment area" works well without any specific errors appearing in the log.




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...