Opened 12 years ago

Last modified 6 years ago

#1996 new defect

r.random.cells not working correctly when min distance is < 0.1

Reported by: pvanbosgeo Owned by: grass-dev@…
Priority: normal Milestone: 7.0.7
Component: Raster Version: svn-trunk
Keywords: r.random.cells Cc:
CPU: Unspecified Platform: Unspecified

Description

I am running r.random.cells in location/mapset with latlon with a resolution of 0.008333. When using a minimum distance of e.g., 0.09 degrees, random locations / cells are selected that are closer then that distance, including selection of neighboring cells.

Attachments (1)

test2.png (5.9 KB ) - added by pvanbosgeo 12 years ago.
random points generated with r.random.cell with minimum distance of 0.09 degrees. Regions resolution is 0.00833.

Download all attachments as: .zip

Change History (9)

comment:1 by martinl, 12 years ago

Component: DefaultRaster
Keywords: r.random.cells added

comment:2 by hamish, 12 years ago

what is your ew, ns region resolution? (the module uses that)

r.random.cells does not know that 1deg lat is not the same distance as 1deg lon. Considering the nature of what it is doing (feeding into future stats) I wouldn't risk the wrong answers, I'd run it from a projected location instead of a lat/lon one.

the module is smart enough to deal with ew,ns resolution (of the same units) being different though.

Hamish

by pvanbosgeo, 12 years ago

Attachment: test2.png added

random points generated with r.random.cell with minimum distance of 0.09 degrees. Regions resolution is 0.00833.

comment:3 by pvanbosgeo, 12 years ago

The region's resolution is 0.008333. Good point about different distances latitudinal and longitudinal. In my specific case it doesn't really matter though, I just want to avoid to select any two cells that are e.g., less then 2 cells apart). A minimum distance of 0.09 should take care of that, shouldn't it. However, the resulting layer does still contain plenty of neighboring cells selected (see attached image).

comment:4 by hamish, 12 years ago

without exploring the code to closely, perhaps what is happening is that the random points in real x,y,z space are more than 1 cell space apart from each other, but at the final rasterization step they trigger filling adjacent cells?

+------+
|   .  |
|      |
|      |
+------+
|      |
|      |
| .    |
+------+

But r.random.cells works on distance between the rows and columns, so perhaps that is wrong and it is comparing distance between cell centers. Further investigation would be needed to see at what stage the rasterization happens.

Hamish

comment:5 by martinl, 9 years ago

Milestone: 7.0.07.0.5

comment:6 by neteler, 8 years ago

Milestone: 7.0.57.0.6

comment:7 by neteler, 7 years ago

Milestone: 7.0.67.0.7

comment:8 by martinl, 6 years ago

What is status of this issue?

Note: See TracTickets for help on using tickets.