[GRASS-dev] [GRASS GIS] #1082: r.random cover= gets stray data in first and last rows

GRASS GIS trac at osgeo.org
Tue Jun 1 15:32:48 EDT 2010


#1082: r.random cover= gets stray data in first and last rows
----------------------+-----------------------------------------------------
 Reporter:  hamish    |       Owner:  grass-dev at lists.osgeo.org
     Type:  defect    |      Status:  new                      
 Priority:  normal    |   Milestone:  6.4.0                    
Component:  default   |     Version:  svn-develbranch6         
 Keywords:  r.random  |    Platform:  Linux                    
      Cpu:  x86-32    |  
----------------------+-----------------------------------------------------
 Hi,

 spearfish:
 {{{
 g.region rast=elevation.dem
 r.random in=elevation.dem cover=fields n=10000 rast=randout
 WARNING: Only [6248] random points created
 }}}

 the resulting "randout" map is nicely filled with random dots but on the
 first and last row of the output raster map there are chunks of solid dots
 which are created no matter what you do.

 a more obvious example:
 {{{
 r.random in=elevation.dem cover=fields n=5 rast=randout
 Collecting Stats...
  100%
 Writing raster map <randout> ...
 WARNING: Only [3] random points created

 # ok, so we should expect n=3 in the output map...
 r.univar randout | grep -w 'n:'
 n: 248
 }}}

 stray blocks of cells are in the same place regardless of n=.

 ----
 also, for cover= it would be nice if random.c looped while(nt) so that it
 ran in multiple passes and you got as many points as you asked for, not
 less.  (like v.random.cover addon does for points)

 I thought about adding nt++ inside is_null_value(cover){...} in the column
 for-loop to counter-act the nt--, but I worry that may harm the overall
 randomness "density" of the rows for-loop. (just a hunch, I haven't proven
 that to myself)


 thanks,
 Hamish

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/1082>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list