Closed gisma closed 3 years ago
Thanks, this is not the rgrass7 repo, rather a development repo for using sf classes for vector data. Please see this thread in grass-stats list: https://lists.osgeo.org/pipermail/grass-stats/2018-September/001768.html; the warning was inserted to handle the OSGeo4W console which puts the user in a no-write-access folder for no good reason. Now OSGeo4W has lost iconv.dll, so there is no easy solution. I'll look at this issue, but putting the throwaway RC file in the R tempdir shouldn't be a problem, but I agree that the warning may be confusing.
Thanks for clarifying and sorry for using the wrong repo :-( I think it is ok to close the issue?
The actual repo is on R-Forge, but stars has not moved as fast as sf, so my idea of refreshing rgrass7 is waiting for now. The R-Forge SVN repo may move to github sometime. I'll close when I find out how to suppress the spurious warning, and report here when done.
Great. Thanks!
On Windows 10, running in an OSGeo4W console, R 3.5.1, rgrass7 0.1-12, isTRUE(file.access(".", 2) == 0) returns TRUE when the directory is writeable, FALSE when it is not writeable. This is also the case when running in a basic Windows command prompt. So I cannot replicate the issue. You have a lot of extra packages loaded, could you please try just at the Windows command prompt, starting R for example as "C:/Program Files/R/R-3.5.1/bin/x84/R.exe".
Thanks, I will check this ASAP (means when getting hold of Windows). It could be that calling R from the OSGeo4W console makes the difference. I avoid to do so, I am using instead the link2GI::linkGRASS7
function for defining the necessary environment settings. Finally I call initGRASS
. Probably I have to drill down here.
OK, so this is probably actually a link2GI issue. I never use OSGeo4W either, but some people do, and it starts by default in a directory without write access. Most Windows command prompt windows, or RGui/RStudio, will start in directores with write permissions.
Using Windows 10 running something like:
rgrass7::initGRASS(gisBase = "C:\\OSGeo4W64\\apps\\grass\\grass-7.7.svn", home = tempdir(), gisDbase = tempdir(), mapset = "PERMANENT", location = "tmp", override = TRUE )
I am getting the warning:
Warning message: In rgrass7::initGRASS(gisBase = "C:\\OSGeo4W64\\apps\\grass\\grass-7.7.svn", : working directory not writable, using tempfile for GISRC
Tracing this down it seems to be the file access test in line 107 of the
initGRASS
function `:(file.access(".", 2) == 0)
returnsTRUE
while the implementedisTRUE(file.access(".", 2) == 0)
returnsFALSE
Actually file acces is granted but in the latter case the warning is thrown and a temporary .rcgrass7 file is generated. Actually this is not a problem at all but the warning is kind of confusing and the check seems to be inconsistent. No warning at all running it under Linux. I am not sure if I am missing something but any suggestions are welcome.
thanks Chris