Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] r.terraflow: fails with grid larger than memory on very small regions #3652

Open
landam opened this issue Apr 23, 2024 · 1 comment
Open
Labels
backport to 8.3 PR needs to be backported to release branch 8.3 bug Something isn't working C++ Related code is in C++ raster Related to raster data processing
Milestone

Comments

@landam
Copy link
Member

landam commented Apr 23, 2024

Describe the bug
r.terraflow fails with "grid larger than memory" error on very small regions

north:      21
south:      -1.5
west:       -1.5
east:       5
nsres:      0.5
ewres:      0.5
rows:       45
cols:       13
cells:      585

To Reproduce
Steps to reproduce the behavior:

  1. Run grass -c EPSG:5514 /tmp/r_terraflow
  2. Run r.unpack input=dem.pack out=dem
  3. Run g.region rast=dem
  4. Run r.terraflow elevation=dem@PERMANENT filled=dem_filled direction=dem_flowdir accumulation=dem_flowacc --o -s
  5. See error
WARNING: Raster map <dem> is of type DCELL_TYPE -- precision may be lost
Reading input data...
 100%
WARNING: grid larger than memory (ignored)
r.terraflow: grid.cpp:33: grid::grid(dimension_type, dimension_type, dimension_type, dimension_type, long int, cclabel_type): Assertion `(size_t)width * height * sizeof(gridElement) < getAvailableMemory()' failed.
Aborted

Expected behavior
r.terraflow should run successfully.

System description (please complete the following information):

  • Operating System: Linux
  • GRASS GIS version: 8.4
@landam landam added the bug Something isn't working label Apr 23, 2024
@landam
Copy link
Member Author

landam commented Apr 23, 2024

It's due ps->size which is very large (140720409312672), see https://github.com/OSGeo/grass/blob/main/raster/r.terraflow/fill.cpp#L454

@landam landam added the raster Related to raster data processing label Apr 23, 2024
@landam landam added this to the 8.4.0 milestone Apr 23, 2024
@landam landam added C++ Related code is in C++ backport to 8.3 PR needs to be backported to release branch 8.3 labels Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport to 8.3 PR needs to be backported to release branch 8.3 bug Something isn't working C++ Related code is in C++ raster Related to raster data processing
Projects
None yet
Development

No branches or pull requests

1 participant