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] Option distance in r.random.cells does not specify minimum distance #1779

Closed
zofie-cimburova opened this issue Aug 5, 2021 · 0 comments · Fixed by #1797
Closed

[Bug] Option distance in r.random.cells does not specify minimum distance #1779

zofie-cimburova opened this issue Aug 5, 2021 · 0 comments · Fixed by #1797
Labels
bug Something isn't working
Milestone

Comments

@zofie-cimburova
Copy link

zofie-cimburova commented Aug 5, 2021

Describe the bug
According to the documentation, r.random.cells should generate a random sets of raster cells that are at least distance apart. I.e., if run with distance set to region resolution and ncells set to number of region cells, one would expect the resulting map to contain no NULLs.
Instead, it seems to generate a set of raster cells that are more than distance apart and with the abovementioned settings, the resulting map contains ~60% NULLs.

To Reproduce
(maps from NC dataset)

  1. set computational region: g.region -p geology_30m@PERMANENT
  2. distribute 225000 cells (ncells in geology_30m@PERMANENT) with 30m distance (resolution of geology_30m@PERMANENT):
    r.random.cells output=rand_cells_30m distance=30 ncells=225000
  3. the output map contains only ~81000 non-null cells
  4. distribute the same number of cells with 29.999m distance:
    r.random.cells output=rand_cells_29m distance=29.999 ncells=225000
  5. The output map contains exactly 225000 non-null cells

Expected behavior
Given the specified distance and number of cells, the output map should contain exactly 225000 non-null cells. Alternatively, the documentation could be changed to r.random.cells generates a random sets of raster cells that are more than distance apart.

System description (please complete the following information):

  • Operating System: Ubuntu 18.04.5 LTS
  • GRASS GIS version 7.8.5
@zofie-cimburova zofie-cimburova added the bug Something isn't working label Aug 5, 2021
@neteler neteler added this to the 8.0.0 milestone Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants