<div dir="ltr">Hi Stefan, <div><br><div>Thanks for your reply. I will try it in case of a permission issue.</div><div><br></div><div>Kind regards,</div><div><br></div><div>Mehrdad</div><div><br></div></div></div><div hspace="streak-pt-mark" style="max-height:1px"><img alt="" style="width:0px;max-height:0px;overflow:hidden" src="https://mailfoogae.appspot.com/t?sender=admFyZWRpQGdtYWlsLmNvbQ%3D%3D&type=zerocontent&guid=2b2b76f8-ee23-410d-819e-4c2b643a6f70"><font color="#ffffff" size="1">ᐧ</font></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Apr 28, 2019 at 5:18 PM Stefan Blumentrath <<a href="mailto:Stefan.Blumentrath@nina.no">Stefan.Blumentrath@nina.no</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="NO-BOK">
<div class="gmail-m_-4368754399439374122WordSection1">
<p class="MsoNormal"><span>Hi Mehrdad,<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">If this is a permission issue, and the dependencies (and a build environment) are installed, you could try compile GRASS (and install it in your home directory if necessary with the
 --prefix configure option).<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">svn checkout
<a href="https://svn.osgeo.org/grass/grass/" target="_blank">https://svn.osgeo.org/grass/grass/</a> grass_trunk<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">cd grass_trunk<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">./configure
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">make<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">make install<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">The make install step is not required for starting GRASS though. The make commando creates a bin…/ directory within the grass_trunk dir, where the grass startupscript is located…<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Hope that helps.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Cheers,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Stefan<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> grass-user <<a href="mailto:grass-user-bounces@lists.osgeo.org" target="_blank">grass-user-bounces@lists.osgeo.org</a>>
<b>On Behalf Of </b>Mehrdad Varedi<br>
<b>Sent:</b> søndag 28. april 2019 18:31<br>
<b>To:</b> Micha Silver <<a href="mailto:tsvibar@gmail.com" target="_blank">tsvibar@gmail.com</a>><br>
<b>Cc:</b> grass-user <<a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a>><br>
<b>Subject:</b> Re: [GRASS-user] Help; Running Grass from R without installing GRASS<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Thank you for your time and sharing your knowledge Micha for the second time.<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I followed your code and found that initGRASS searches for libraries and binaries of GRASS in gisBase folder. If we address a folder that doesn't have the code it comes back with this error message: "The code execution cannot proceed because
 libgrass_gis.7.4.1.dll was not found. Reinstalling the program may fix this problem." it gives the same error even if I copy that file into GISBase folder.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I want to run my code on a shiny server which I can't install GRASS although I can copy files and libraries. Can I solve this issue by copying a certain folder of GRASS binaries with my app or I am going the wrong path?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Please advise,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thank you once again for all the time you share to answer my questions,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Mehrdad<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><img border="0" id="gmail-m_-4368754399439374122_x0000_i1025" src="https://mailfoogae.appspot.com/t?sender=admFyZWRpQGdtYWlsLmNvbQ%3D%3D&type=zerocontent&guid=6036490f-455f-4578-9a0d-ec0122c7134a"><span style="font-size:7.5pt;font-family:Gadugi,sans-serif;color:white">ᐧ</span><u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Sun, Apr 28, 2019 at 10:55 AM Micha Silver <<a href="mailto:tsvibar@gmail.com" target="_blank">tsvibar@gmail.com</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On 27/04/2019 22:05, Mehrdad Varedi wrote:<u></u><u></u></p>
</div>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<div>
<p class="MsoNormal"><br clear="all">
<u></u><u></u></p>
<div>
<p class="MsoNormal">Hi Everyone, <u></u><u></u></p>
<div>
<p class="MsoNormal">I have detail explanations of connecting to an existing dataset in GRASS from R in this address: <a href="https://grasswiki.osgeo.org/wiki/R_statistics/rgrass7" target="_blank">https://grasswiki.osgeo.org/wiki/R_statistics/rgrass7</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">What I hope I could do is to create a GRASS dataset in R on the fly and without the need to install GRASS or create a dataset on it. Is there any way to do this?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
</blockquote>
<p>Maybe this will help:<u></u><u></u></p>
<p>(You must have GRASS installed, of course)<u></u><u></u></p>
<p><u></u> <u></u></p>
<p><tt><span style="font-size:10pt"># Parameters for the GRASS installation and temporary GRASS mapset</span></tt><u></u><u></u></p>
<p><tt><span style="font-size:10pt">GISBase = "/usr/lib/grass76"</span></tt><br>
<tt><span style="font-size:10.5pt"># Set these as you like</span></tt><u></u><u></u></p>
<p><tt><span style="font-size:10pt">GISDbase = "/tmp"</span></tt><span style="font-size:10pt;font-family:"Courier New""><br>
<tt>Location = "tmp_location"</tt><br>
<tt>Mapset = "tmp_mapset"</tt><br>
<tt>georef = "EPSG:2039"</tt><br>
<br>
<tt>mapset_path = file.path(GISDbase, Location, Mapset)</tt></span><u></u><u></u></p>
<p><tt><span style="font-size:13.5pt"># Now run the 'grass' command within R and </span>
</tt><u></u><u></u></p>
<p><tt><span style="font-size:10pt"># use the -c and -e flags to create the temp mapset, then exit</span></tt><u></u><u></u></p>
<p><tt><span style="font-size:10pt">setup_grass_cmd = paste("grass", "-c", georef, "-e", mapset_path)</span></tt><u></u><u></u></p>
<p><tt><span style="font-size:10pt">system(setup_grass_cmd)</span></tt><u></u><u></u></p>
<p><u></u> <u></u></p>
<p><span style="font-size:13.5pt;font-family:"Courier New""># Load the R grass interface and initialize GRASS within R,
</span><u></u><u></u></p>
<p><span style="font-size:13.5pt;font-family:"Courier New""># using the temporary mapset from above</span><u></u><u></u></p>
<p><tt><span style="font-size:10pt">library(rgrass7)</span></tt><span style="font-size:10pt;font-family:"Courier New""><br>
<tt>initGRASS(home=tempdir(), </tt><br>
<tt>          gisBase = GISBase,</tt><br>
<tt>          gisDbase = GISDbase,</tt><br>
<tt>          location = Location,</tt><br>
<tt>          mapset = Mapset,</tt><br>
<tt>          remove_GISRC = TRUE)</tt></span><u></u><u></u></p>
<p><u></u> <u></u></p>
<p><tt><span style="font-size:10pt"># Try some GRASS commands</span></tt><u></u><u></u></p>
<p><tt><span style="font-size:10pt">input_tif = "isrlat12.tif" </span></tt><u></u><u></u></p>
<p style="margin-bottom:12pt"><tt><span style="font-size:10pt">grass_rast = "isrlat12"</span></tt><span style="font-size:10pt;font-family:"Courier New""><br>
<tt>execGRASS("r.in.gdal",  flags = c("o","overwrite"),</tt><br>
<tt>          input = input_tif,</tt><br>
<tt>          output = grass_rast)</tt><br>
<tt>execGRASS("g.region", flags="p", raster = grass_rast)</tt></span><u></u><u></u></p>
<p>I did not add a command to remove the temporary mapset.  Something like:<u></u><u></u></p>
<p><tt><span style="font-size:10pt">unlink(file.path(GISDbase, Location), recusive = TRUE)</span></tt> might be necessary<u></u><u></u></p>
<p><u></u> <u></u></p>
<p>One other note: you probably will get better suggestions on the R-sig-geo list...<u></u><u></u></p>
<p><u></u> <u></u></p>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<div>
<div>
<div>
<p class="MsoNormal">i.e. I have a vector /raster file and use that to identify the region and details required to set up a dataset and use GRASS functions just by including rgrass library.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks for your help and attention,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Mehrdad<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal">-- <u></u><u></u></p>
<div>
<p class="MsoNormal">Mehrdad Varedi<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><img border="0" id="gmail-m_-4368754399439374122_x0000_i1026" src="https://mailfoogae.appspot.com/t?sender=admFyZWRpQGdtYWlsLmNvbQ%3D%3D&type=zerocontent&guid=dbe7ab29-5a21-45c9-97bb-082f4f48224a"><span style="font-size:7.5pt;font-family:Gadugi,sans-serif;color:white">ᐧ</span><u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<pre>_______________________________________________<u></u><u></u></pre>
<pre>grass-user mailing list<u></u><u></u></pre>
<pre><a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a><u></u><u></u></pre>
<pre><a href="https://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-user</a><u></u><u></u></pre>
</blockquote>
<pre>-- <u></u><u></u></pre>
<pre>Micha Silver<u></u><u></u></pre>
<pre>Ben Gurion Univ.<u></u><u></u></pre>
<pre>Sde Boker, Remote Sensing Lab<u></u><u></u></pre>
<pre>cell: +972-523-665918<u></u><u></u></pre>
</div>
</blockquote>
</div>
<p class="MsoNormal"><br clear="all">
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">-- <u></u><u></u></p>
<div>
<p class="MsoNormal">Mehrdad Varedi<u></u><u></u></p>
</div>
</div>
</div>

</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Mehrdad Varedi</div>