Opened 12 years ago
Closed 6 years ago
#1977 closed defect (wontfix)
r.random.cells does not respect MASK
Reported by: | pvanbosgeo | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.0.7 |
Component: | Raster | Version: | svn-trunk |
Keywords: | r.random.cells, mask | Cc: | |
CPU: | Unspecified | Platform: | Unspecified |
Description
In the helpfile of r.random.cells, it is mentioned that "Random cells will not be generated in areas masked off". However, in reality the function does not (seem to) respect the MASK.
Change History (13)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
Milestone: | 6.4.3 → 7.0.0 |
---|---|
Version: | unspecified → svn-trunk |
... works for me on linux in 6.4.3svn (as per the milestone), but not trunk.
Hamish
comment:3 by , 12 years ago
Ah, yes, its not working for me on trunk. Sorry for the wrong milestone and not mentioning this was with grass 7. The mentioned add-on works, but it does not enforce a minimal spacing between points as far as I can see.
comment:4 by , 12 years ago
ok, for now the GRASS 6.x version or r.random.cells should work fine as a work-around.
no, v.random.cover doesn't enforce minimal spacing currently (feel free to file a wish for that).
thanks for reporting it, Hamish
follow-up: 7 comment:5 by , 12 years ago
Replying to pvanbosgeo:
In the helpfile of r.random.cells, it is mentioned that "Random cells will not be generated in areas masked off". However, in reality the function does not (seem to) respect the MASK.
Try r56375. The bug comes from the times when zero was regarded as NULL. Actually it should not work either in 6.x because for CELL_TYPE NULL != 0.
comment:6 by , 12 years ago
Great, it works now, with the note that all cells other than the random points (cells) have the value 0, including all cells outside the masked area. That is fine, although a suggestion might be to set all cells, except obviously the random points, to NULL, like r.random does.
follow-up: 8 comment:7 by , 12 years ago
Replying to mmetz:
Actually it should not work either in 6.x because for CELL_TYPE NULL != 0.
and yet it does work there.
perhaps because it uses G_get_map_row_nomask()?
shrug, Hamish
comment:8 by , 12 years ago
Replying to hamish:
Replying to mmetz:
Actually it should not work either in 6.x because for CELL_TYPE NULL != 0.
and yet it does work there.
perhaps because it uses G_get_map_row_nomask()?
Trunk uses Rast_get_c_row_nomask().
I created a MASK that contains only NULL and 1, no zero. Therefore I think it is a bug in G_get_map_row_nomask() of 6.x, converting NULL to zero.
comment:9 by , 12 years ago
seeing that all is working fine in 6.x I'd err on the side of not messing with it.
regards, Hamish
comment:10 by , 9 years ago
Milestone: | 7.0.0 → 7.0.5 |
---|
comment:11 by , 8 years ago
Milestone: | 7.0.5 → 7.0.6 |
---|
comment:12 by , 7 years ago
Milestone: | 7.0.6 → 7.0.7 |
---|
comment:13 by , 6 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
No activity for a long time. Closing. Feel free to reopen if needed.
Works for me -- random cells are only created in the MASKed areas. the areas not covered by the MASK map are flood filled with "0". (use "r.null setnull=0" to clear that away)
... and random points only occur in places covered by the MASK map.
was your MASK map a CELL (integer) type?
see also the v.random.cover addon module, which may do something like what you are looking for.
Hamish