[GRASS-user] random raster map

Dear All,

How can I create a raster map with random values between a minimum and a
max value ?
I tried r.random but I do not know how to specify these min anx max values.

Thanks in advance,

Jessica

_________________________________________

Jessica Gervais
Tel: +352- 425991-628
Mail: jessica.gervais@tudor.lu

Resource Centre for Environmental Technologies,
Public Research Centre Henri Tudor,
Technoport Schlassgoart,
66 rue de Luxembourg,
P.O. BOX 144,
L-4002 Esch-sur-Alzette, Luxembourg

Hi,

2008/7/14 <jessica.gervais@tudor.lu>:

How can I create a raster map with random values between a minimum and a
max value ?
I tried r.random but I do not know how to specify these min anx max values.

you can create vector points layer by

v.random out=vrandom n=1000 zmin=0 zmax=100 -z

and then rasterize it

v.to.rast in=vrandom out=rrandom use=z

or to get random surface layer use

r.surf.random out=rsurf min=0 max=100

Martin

PS: Please update your contact info: grassuser@grass.itc.it ->
grass-user@lists.osgeo.org
--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa *

A simple hint.
if you want your number being between XMax and XMin you could use:

x = random_number(XMax-XMin)+XMin

where 0<=random_number<=1

Anyway, r.mapcalc already contains rand(min,max), wich produces
exactly what you want [1]

giovanni

[1] http://grass.itc.it/grass63/manuals/html63_user/r.mapcalc.html

2008/7/14 <jessica.gervais@tudor.lu>:

Dear All,

How can I create a raster map with random values between a minimum and a
max value ?
I tried r.random but I do not know how to specify these min anx max values.

Thanks in advance,

Jessica

_________________________________________

Jessica Gervais
Tel: +352- 425991-628
Mail: jessica.gervais@tudor.lu

Resource Centre for Environmental Technologies,
Public Research Centre Henri Tudor,
Technoport Schlassgoart,
66 rue de Luxembourg,
P.O. BOX 144,
L-4002 Esch-sur-Alzette, Luxembourg

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

jessica.gervais@tudor.lu pisze:

Dear All,

How can I create a raster map with random values between a minimum
and a max value ? I tried r.random but I do not know how to specify
these min anx max values.

In case you are not sure what GRASS module to use, but have a general
idea of what you are looking for, enter the directory where GRASS html
manual is stored on your machine and search for the keyword inside the
html files.

A search for "random" in html files of raster modules (i.e. those
matching r*html wildcard) returns for me:

/usr/local/grass-6.4.svn/docs/html/r3.mapcalc.html
/usr/local/grass-6.4.svn/docs/html/raster.html
/usr/local/grass-6.4.svn/docs/html/r.clump.html
/usr/local/grass-6.4.svn/docs/html/r.colors.html
/usr/local/grass-6.4.svn/docs/html/r.cost.html
/usr/local/grass-6.4.svn/docs/html/r.cross.html
/usr/local/grass-6.4.svn/docs/html/r.le.setup.html
/usr/local/grass-6.4.svn/docs/html/r.li.html
/usr/local/grass-6.4.svn/docs/html/r.li.setup.html
/usr/local/grass-6.4.svn/docs/html/r.mapcalc.html
/usr/local/grass-6.4.svn/docs/html/r.random.cells.html
/usr/local/grass-6.4.svn/docs/html/r.random.html
/usr/local/grass-6.4.svn/docs/html/r.random.surface.html
/usr/local/grass-6.4.svn/docs/html/r.surf.fractal.html
/usr/local/grass-6.4.svn/docs/html/r.surf.gauss.html
/usr/local/grass-6.4.svn/docs/html/r.surf.idw2.html
/usr/local/grass-6.4.svn/docs/html/r.surf.idw.html
/usr/local/grass-6.4.svn/docs/html/r.surf.random.html
/usr/local/grass-6.4.svn/docs/html/r.texture.html

Maciek

--
Maciej Sieczka
www.sieczka.org

Hi,

2008/7/14 Maciej Sieczka <tutey@o2.pl>:

How can I create a raster map with random values between a minimum
and a max value ? I tried r.random but I do not know how to specify
these min anx max values.

[...]

In case you are not sure what GRASS module to use, but have a general
idea of what you are looking for, enter the directory where GRASS html
manual is stored on your machine and search for the keyword inside the
html files.

A search for "random" in html files of raster modules (i.e. those
matching r*html wildcard) returns for me:

/usr/local/grass-6.4.svn/docs/html/r3.mapcalc.html
/usr/local/grass-6.4.svn/docs/html/raster.html

[...]

BTW there is plan to implement search engine in wxGUI (not sure when,
too much busy now).

http://grass.osgeo.org/wiki/WxPython-based_GUI_for_GRASS#Roadmap

Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa *

If You are interested in random surface (all cells with random values)
You can use r.mapcalc rand(min, max) or r.random.cells or
r.random.surface etc.
To get raster with random POINTS use r.random and provide random
SURFACE map as input for resulting point values.

Like this:
r.mapcalc rsurf=rand(min,max)
r.random input=rsurf raster_output=rpoints n=NUMBEROFPOINTS

I hope one of many GRASS user answers contained solution for You.
Maris.

2008/7/14, jessica.gervais@tudor.lu <jessica.gervais@tudor.lu>:

Dear All,

How can I create a raster map with random values between a minimum and a
max value ?
I tried r.random but I do not know how to specify these min anx max values.

Thanks in advance,

Jessica

_________________________________________

Jessica Gervais
Tel: +352- 425991-628
Mail: jessica.gervais@tudor.lu

Resource Centre for Environmental Technologies,
Public Research Centre Henri Tudor,
Technoport Schlassgoart,
66 rue de Luxembourg,
P.O. BOX 144,
L-4002 Esch-sur-Alzette, Luxembourg

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user