[GRASS-user] Re: Monte Carlo realizations of categorical maps.

Hamish hamish_b at yahoo.com
Wed Jun 22 22:41:13 EDT 2011


Marcello wrote:
> I am interested in a module that seems to be discontinued since GRASS 4.
> It is called r.random.model and it is used for Monte Carlo realizations
> of categorical maps.

looking in the 4.3 source code I see nothing by that name, although
src.alpha/raster/ehlschlaeger/r.random/welcome.html
has some info in it; copied here:

http://adhoc.osgeo.osuosl.org/grass/misc/ehlschlaeger_grass43_random.html

although the links lead nowhere. (r.1dcorr source is the only one there)


the r.random module in GRASS 4.3 has this README:

/*********************************************************************
 * GRASS program to create a cell file with non-zero data
 *         in random locations.
 * Locations will be within non-zero data in the input layer.
 *        (unless -z option specified)
 * If it necessary to restrict the locations to only some categories
 *    of the input map, a reclass map should be constructed first
 *    and used as input to this program.
 *
 * Number of random cells can be a fixed number or a percentage of cells.
 *
 * Resulting cell file consists of original cell values at the selected
 *         random locations and zero elsewhere.
 *
 * A sitefile may optionally be created.
 *
 * Usage:
 *  r.random [-qz] input=name [raster_output=name] [sites_output=name] n=n[%]
 *
 *    -q means run quietly
 *    -z means generate random locations for zero-data as well
 *
 *
 * Note if called by interactive r.random, the first arg will be ####n
 *      where n is the number of cells in the input map.
 *********************************************************************/



also, for a categorical map you might try r.to.vect + the v.random.cover
module for GRASS 6 from addons:
   http://grass.osgeo.org/wiki/Addons#v.random.cover

"v.random.cover is a shell script for creating random points constrained within an irregularly shaped vector area. (v.random places points only in current region rectangle). Optionally the user can upload raster values at the points. See also 'r.random cover= vector_output='"



> Rainer:
> Me to - sounds really interesting. But even a google search did not
> result in anyhing -

fwiw, some of the grass5 parts of the website (not sure about grass4)
have been hidden from google searches via robots.txt. (after grass6
came out all searches just lead to old and misleading grass5 answers..
I'm not excited about that solution, but don't have a better idea)

> so why not contact the author?

(he still emails comments from time to time, so your chances are good.
let me know if the email you tried was too old, I may have a newer one
somewhere)


maybe it helps,
Hamish



More information about the grass-user mailing list