<div dir="ltr"><div><div><div>Thanks Paulo and Thomas, <br></div>perfect the <a href="https://grass.osgeo.org/grass70/manuals/r.surf.random.html" target="_blank">r.surf.random</a> does what i want!! I know how to implement the code!<br></div>Thanks!! <br></div>p.s. better to put the <a href="https://grass.osgeo.org/grass70/manuals/r.surf.random.html" target="_blank">r.surf.random</a> link at the bottom of <span class="im"><a href="https://grass.osgeo.org/grass70/manuals/r.random.surface.html" target="_blank">r.random.surface</a></span><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 16 February 2016 at 03:47, Paulo van Breugel <span dir="ltr"><<a href="mailto:p.vanbreugel@gmail.com" target="_blank">p.vanbreugel@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF"><span class="">
    <br>
    <br>
    <div>On 16-02-16 05:04, Thomas Adams wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div><span style="color:rgb(0,0,0)"><span>Giuseppe,<br>
                  <br>
                </span></span></div>
            <span style="color:rgb(0,0,0)"><span>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>Best,<br>
            </span></span></div>
        <span style="color:rgb(0,0,0)"><span>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 href="mailto:giuseppe.amatulli@gmail.com" target="_blank"></a><a href="mailto:giuseppe.amatulli@gmail.com" target="_blank">giuseppe.amatulli@gmail.com</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 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></span>
    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" target="_blank"></a><a href="https://grass.osgeo.org/grass70/manuals/r.surf.random.html" target="_blank">https://grass.osgeo.org/grass70/manuals/r.surf.random.html</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><div><div class="h5">
    <br>
    <blockquote 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><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 href="http://spatial-ecology.net" target="_blank">spatial-ecology.net</a>
                                      </div>
                                      Work:  <a 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 href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a><br>
            <a 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>
          <div dir="ltr">
            <div>Thomas E Adams, III
              <div>2330 Jack Warner PKWY, #334</div>
              <div>Tuscaloosa, AL 35401</div>
              <div><br>
              </div>
              <div><a href="tel:1%20%28513%29%20739-9512" value="+15137399512" target="_blank">1 (513) 739-9512</a> (cell)</div>
              <div><br>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
grass-user mailing list
<a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a></pre>
    </blockquote>
    <br>
  </div></div></div>

</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><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 href="http://spatial-ecology.net" target="_blank">spatial-ecology.net</a>
  </div> 
  
   Work:  <a href="http://sbsc.yale.edu/giuseppe-amatulli" target="_blank">http://sbsc.yale.edu/giuseppe-amatulli</a> <br><a href="http://www.spatial-ecology.net" target="_blank"></a></div></div></div></div></div></div></div></div>
</div>