tpilz / lumpR

Landscape Unit Mapping Program for R
GNU General Public License v3.0
11 stars 12 forks source link

memory issues with calc_subbas #41

Closed A-Mue closed 6 years ago

A-Mue commented 6 years ago

For large catchments (e.g. Sao Francisco) calc_subbas issues this error:

Calculate drainage and river network... ABSCHNITT 1a (von 4): Initiiere den Speicher. Aktuelle Region Zeilen: 20217, Spalten: 14047 FEHLER: G_malloc: Kann nicht 2272853112 Byte auf init_vars.c:134 reservieren

According to other users, this is a memory issue, created by GRASS GIS r.watershed

It is recommended to activate the flag -m (Enable disk swap memory option: Operation is slow Only needed if memory requirements exceed available RAM; see manual on how to calculate memory requirements, http://grass.osgeo.org/grass70/manuals/r.watershed.html#in-memory-mode-and-disk-swap-mode)

tpilz commented 6 years ago

I will try to add the option with the update to GRASS 7. This, however, might still take a while due to bugs in GRASS functions essential for lumpR. In the meantime, also consider suggestions given in #16 and #28.

TillF commented 6 years ago

I introduced the optional argument "disk_swap". If set to TRUE, this will use the "w"-flag. Please check and report. Alternatively, both 'flowaccum' and 'flowdir' maps can now be computed externally, e.g. with r.terraflow which is supposed to better handle large grids. Make sure grid coding conventions are consistent. Please report or reopen issue when the need arises.