<div dir="ltr"><div>Hi Mehrdad,<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 20, 2020 at 9:06 AM Mehrdad Varedi <<a href="mailto:varedi@waterlix.com">varedi@waterlix.com</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 dir="ltr"><div dir="ltr"><div dir="ltr">Hi everybody,<div>my hope is to reference the necessary files and folders or copy them on an R image to use GRASS functions in R.</div><div><br></div><div>I have a Docker file like the following:</div><div><br></div><div><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><b>FROM neteler/grassgis7 as thegrass</b></span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><b><span style="font-variant-ligatures:no-common-ligatures"></span><br></b></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><b>FROM rocker/rstudio</b></span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><b>COPY --from=thegrass /usr/local/grass79 /usr/local/grass79</b></span></p></div></div></div></div></blockquote><div><br></div><div></div><div>Here you only copy (if I am not mistaken) the grass79 folder but not the related system-wide installed PROJ, GDAL etc libs.</div><div>They are in /usr/lib[64]/... (don't know precisely right now).<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><b>COPY --from=thegrass /data /data</b></span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><b>COPY --from=thegrass /home/grass /home/grass</b></span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><b><span style="font-variant-ligatures:no-common-ligatures"></span><br></b></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><b>RUN sudo apt-get install -y libcurl4-openssl-dev libxml2-dev</b></span></p></div></div></div></div></blockquote><div><br></div><div>I suppose you also need to install the geo software stack here as well (see</div><div><a href="https://hub.docker.com/r/neteler/grassgis7/dockerfile">https://hub.docker.com/r/neteler/grassgis7/dockerfile</a></div><div>)<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div></div><div>Then I build and run the image which has a few folders from GRASS GIS</div><div>In RStudio, I install and call the "rgrass7" and "raster" libraries. (No errors)</div><div><br></div><div>Then in Rstudio, I try to run the initGRASS function with the following values:</div><div><pre id="gmail-m_5436602288646990355gmail-rstudio_console_output" style="font-family:Monaco,monospace,monospace;font-size:12px;outline:currentcolor none medium;border:medium none;word-break:break-all;margin-top:0px;margin-bottom:0px;line-height:1.45;color:rgb(0,0,0);white-space:pre-wrap"><span style="color:blue">initGRASS(gisBase = "/usr/local/grass79", home = raster::tmpDir(), gisDbase = "tmpDbase", location = "Kitchener", mapset = "PERMANENT", override = TRUE)</span></pre><pre id="gmail-m_5436602288646990355gmail-rstudio_console_output" style="font-family:Monaco,monospace,monospace;font-size:12px;outline:currentcolor none medium;border:medium none;word-break:break-all;margin-top:0px;margin-bottom:0px;line-height:1.45;color:rgb(0,0,0);white-space:pre-wrap"><span style="color:blue"><br></span></pre><pre id="gmail-m_5436602288646990355gmail-rstudio_console_output" style="font-family:Monaco,monospace,monospace;font-size:12px;outline:currentcolor none medium;border:medium none;word-break:break-all;margin-top:0px;margin-bottom:0px;line-height:1.45;color:rgb(0,0,0);white-space:pre-wrap"><span style="color:blue">This is the error I recieve:
</span><span style="color:rgb(197,6,11)">Error in parseGRASS(cmd, legacyExec = legacyExec) : The command
g.region --interface-description
could not be run (127), and produced the error message:
g.region: error while loading shared libraries: libproj.so.12: cannot open shared object file: No such file or directory</span></pre></div></div></div></div></blockquote><div><br></div><div>Yes, because it isn't there yet (see above).<br></div><div><br></div><div>Hope this helps,</div><div><br></div><div>Markus</div><div><br></div><div><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 dir="ltr"><div dir="ltr"><div dir="ltr"><div><pre id="gmail-m_5436602288646990355gmail-rstudio_console_output" style="font-family:Monaco,monospace,monospace;font-size:12px;outline:currentcolor none medium;border:medium none;word-break:break-all;margin-top:0px;margin-bottom:0px;line-height:1.45;color:rgb(0,0,0);white-space:pre-wrap"><span style="color:rgb(197,6,11)">
</span><span style="color:rgb(197,6,11)">In addition: </span><span style="color:rgb(197,6,11)">Warning message:
</span><span style="color:rgb(197,6,11)">In system2(command = command, args = arguments, stdout = outFile, :
</span><span style="color:rgb(197,6,11)"> </span><span style="color:rgb(197,6,11)"> error in running command</span></pre></div><div><br></div><div>Do you know a better way to merge the GRASS GIS files with the R image?</div><div>Would you please help me to complete the Dockerfile to avoid such errors?</div><div><br clear="all"><div><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><div>Kind regards,</div><div><br></div><div>Mehrdad</div><div><br></div><div><img src="https://docs.google.com/uc?export=download&id=1Xxc6Ymwo9RC5flfX9TWSpXBYvNpJiYQq&revid=0B1oBiE3Da0LEYUIvTnZnQmI0WjV2ejhDdFdTRzlCVUM2OFVvPQ" width="96" height="16"><br></div><div>Mehrdad Varedi, <a href="http://M.A.Sc" target="_blank">M.A.Sc</a>.<br></div><a href="http://www.waterlix.com" target="_blank">Waterlix</a> Inc. Founder<br></div><div><a href="http://www.waterlix.com" target="_blank">www.waterlix.com</a><br></div>Cell: +1 (519)722-7057<br></div></div></div></div></div></div></div></div></div></div></div></div>
_______________________________________________<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="https://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-user</a></blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">Markus Neteler, PhD<br><a href="https://www.mundialis.de" target="_blank">https://www.mundialis.de</a> - free data with free software<br><a href="https://grass.osgeo.org" target="_blank">https://grass.osgeo.org</a><br><a href="https://courses.neteler.org/blog" target="_blank">https://courses.neteler.org/blog</a></div></div>