<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body smarttemplateinserted="true" text="#000000" bgcolor="#FFFFFF">
<br>
<br>
<div class="moz-cite-prefix">On 16-02-16 05:04, Thomas Adams wrote:<br>
</div>
<blockquote
cite="mid:CAGxgkWig=8UM8h=Zz+8-QBySOhA_Ct7XzSYmaQ0fZm-EF03RcA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>
<div><span style="color:rgb(0,0,0)"><span class="">Giuseppe,<br>
<br>
</span></span></div>
<span style="color:rgb(0,0,0)"><span class="">Unless I have
misunderstood, in GRASS use r.mapcalc...<br>
<br>
First set you region for your area of interest, for
example:<br>
<br>
g.region -dp e=2614612.5 w=1423987.5 n=-4624387.5
s=-5862637.5<br>
</span></span><br>
Then:<br>
r.mapcalc expression="outputMap=25.4"<br>
<br>
</div>
<div>where 25.4 is your value of interest, and finally:<br>
<br>
r.out.gdal input=outputMap output=outputFileName
format=GTiff<br>
</div>
<br>
<span style="color:rgb(0,0,0)"><span class="">Best,<br>
</span></span></div>
<span style="color:rgb(0,0,0)"><span class="">Tom<br>
</span></span></div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Mon, Feb 15, 2016 at 9:33 PM,
Giuseppe Amatulli <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:giuseppe.amatulli@gmail.com" target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:giuseppe.amatulli@gmail.com">giuseppe.amatulli@gmail.com</a></a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div>Hi, <br>
</div>
I would like to create an uniform random raster, similar
to what i would obtain in R with the following code <br>
<div>
<div><br>
raster=raster(matrix(runif(54210, max=50, min=-50,
139,390) , ...........)<br>
writeRaster(raster,filename=random.tif",formats=GTiff,overwrite=TRUE)<br>
<br>
</div>
<div>I read the explanation of<br>
<a moz-do-not-send="true"
href="https://grass.osgeo.org/grass7/manuals/r.random.surface.html"
target="_blank">https://grass.osgeo.org/grass7/manuals/r.random.surface.html</a><br>
</div>
<div>and also r.mapcalc - random (a,b) <br>
</div>
<div>but I'm not sure if one of them produce the same
concept/result. <br>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</blockquote>
<br>
That function creates random surface(s) with spatial dependence
(there is a small typo in the link, it should be grass70). What you
want, I think, is the r.surf.random function (<a
href="https://grass.osgeo.org/grass70/manuals/r.surf.random.html"><a class="moz-txt-link-freetext" href="https://grass.osgeo.org/grass70/manuals/r.surf.random.html">https://grass.osgeo.org/grass70/manuals/r.surf.random.html</a></a>).
The r.mapcalc - random(a,b) should also do what you want, it also
gives a uniform distribution.<br>
<br>
p.s. some of the brackets in your R code above are off, it should
probably be something like raster=raster(matrix(runif(54210, max=50,
min=-50), 139,390) , ...........). Like Thomas wrote, in GRASS you
first need to define your region and set your resolution (check out
g.region for all settings, including the option to set number of
rows and columns). Than you can run r.surf.random or r.mapcalc to
generate your new random surface layer. <br>
<br>
<blockquote
cite="mid:CAGxgkWig=8UM8h=Zz+8-QBySOhA_Ct7XzSYmaQ0fZm-EF03RcA@mail.gmail.com"
type="cite">
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div>
<div><br>
</div>
<div>Any input? or better explanation<br>
<br>
</div>
<div>Thanks <br>
</div>
<div>Best <br>
</div>
<span class="HOEnZb"><font color="#888888">
<div>Giuseppe<br>
</div>
<div><br>
-- <br>
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>Giuseppe Amatulli, Ph.D. <br>
<br>
Department of Ecology and
Evolutionary Biology, Yale
University.<br>
</div>
Jetz Lab, OML Room
405 <span>
</span><span> </span><br>
<div>
<div> P.O. Box 208106<br>
165 PROSPECT ST<br>
New Haven, CT 06520-8106<br>
<div> Teaching: <a
moz-do-not-send="true"
href="http://spatial-ecology.net"
target="_blank">spatial-ecology.net</a>
</div>
Work: <a moz-do-not-send="true"
href="http://sbsc.yale.edu/giuseppe-amatulli" target="_blank">http://sbsc.yale.edu/giuseppe-amatulli</a>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</font></span></div>
</div>
<br>
_______________________________________________<br>
grass-user mailing list<br>
<a moz-do-not-send="true"
href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
<a moz-do-not-send="true"
href="http://lists.osgeo.org/mailman/listinfo/grass-user"
rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
<div class="gmail_signature">
<div dir="ltr">
<div>Thomas E Adams, III
<div>2330 Jack Warner PKWY, #334</div>
<div>Tuscaloosa, AL 35401</div>
<div><br>
</div>
<div>1 (513) 739-9512 (cell)</div>
<div><br>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
grass-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/grass-user">http://lists.osgeo.org/mailman/listinfo/grass-user</a></pre>
</blockquote>
<br>
</body>
</html>