Bug report #8607

saga grid volume algorithm

Added by matteo ghetta over 10 years ago. Updated almost 9 years ago.

Status:Closed
Priority:Normal
Assignee:Victor Olaya
Category:Processing/Core
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:17348

Description

No output produced (only visible in the results dialog).

2014-11-14_114547.jpg (77.8 KB) changyuchuan cyc, 2014-11-13 07:47 PM

Associated revisions

Revision 195d98f4
Added by Nyall Dawson over 5 years ago

[needs-docs][processing] Port SAGA raster surface volume to native QGIS alg

The SAGA version of this algorithm is of limited use in QGIS, because the
volume calculated is embedded only in the SAGA terminal output. This prevents
it being saved to a file, or reused within a model as an input to a later
model step.

It's also very user-unfriendly, because users must know to manually scan
the algorithm log to find the SAGA output.

Given that the maths here is trivial, this commit ports the algorithm across
to be a native QGIS c++ algorithm. The algorithm duplicates the SAGA alg
1:1, but outputs the volume (and area) to either a HTML report, or a vector
table. Additionally, the outputs are exported as numeric outputs from the
algorithm, allowing them to be re-used within models.

(It's also considerably faster, because it avoids the forced conversion
to SAGA raster format)

Fixes #8607 (properly, even though that report is closed)

History

#1 Updated by Giovanni Manghi over 10 years ago

  • Status changed from Open to Feedback

that is, the module produces as output just a value, printing it on screen. Try it from the command line. I don't know if this can be made more clear in Sextante.

#2 Updated by Giovanni Manghi almost 10 years ago

  • Resolution set to invalid
  • Status changed from Feedback to Closed

closing for lack of feedback.

#3 Updated by matteo ghetta almost 10 years ago

  • Status changed from Closed to Reopened

Confirmed the lack of output.
Tried with all the 4 parameters: result appears only in the LOG tab.
This is the output with a sample raster:

Grid system: 87.854333; 3252x 1721y; 515820.302167x 4847813.060164y
Grid: DEM_ER
Method: Add Volumes Below Base Level
Base Level: 0.000000

Grid Volume: Volume: 6420566440784.032227
Inconsistency detected by ld.so: dl-close.c: 762: _dl_close: Assertion `map->l_init_called' failed!
Converting outputs
Loading resulting layers
Algorithm Grid volume finished

#4 Updated by Giovanni Manghi almost 10 years ago

  • Status changed from Reopened to Closed

the module has no other output and as far as I know we cannot output to html with SAGA (like it happens in GRASS, broke anyway). Compare this two, the first (grid volume) has no output parameter, while the other (example, grid sum) has it

giovanni@sibirica ~/Desktop $ saga_cmd grid_calculus 2

_____________________________________________

   #####   ##   #####    ##
  ###     ###  ##       ###
   ###   # ## ##  #### # ##
    ### ##### ##    # #####
 ##### #   ##  ##### #   ##
_____________________________________________

_____________________________________________
library path:    /usr/lib/saga/libgrid_calculus.so
library name:    Grid - Calculus
module name :    Grid Volume
author      :    (c) 2005 by O.Conrad
_____________________________________________

Usage: saga_cmd -GRID <str> [-METHOD <str>] [-LEVEL <str>]
  -GRID:<str>      Grid
    Grid (input)
  -METHOD:<str>    Method
    Choice
    Available Choices:
    [0] Count Only Above Base Level
    [1] Count Only Below Base Level
    [2] Subtract Volumes Below Base Level
    [3] Add Volumes Below Base Level
    Default: 0
  -LEVEL:<str>     Base Level
    Floating point
    Default: 0.000000

giovanni@sibirica ~/Desktop $ saga_cmd grid_calculus 8
_____________________________________________

   #####   ##   #####    ##
  ###     ###  ##       ###
   ###   # ## ##  #### # ##
    ### ##### ##    # #####
 ##### #   ##  ##### #   ##
_____________________________________________

_____________________________________________
library path:    /usr/lib/saga/libgrid_calculus.so
library name:    Grid - Calculus
module name :    Grids Sum
author      :    O. Conrad (c) 2010
_____________________________________________

Usage: saga_cmd -GRIDS <str> [-RESULT <str>]
  -GRIDS:<str>     Grids
    Grid list (input)
  -RESULT:<str>    Sum
    Grid (output)

#5 Updated by changyuchuan cyc over 9 years ago

go to Rrocessing -> Options -> general -> confirme item no.5

PS: my qis version is 2.6.0

#6 Updated by Giovanni Manghi almost 9 years ago

  • Category changed from 94 to Processing/Core

Also available in: Atom PDF