[GRASS-stats] Error when starting grass from R (grass installed thru osgeo4w)
Roger Bivand
Roger.Bivand at nhh.no
Wed Sep 19 12:31:12 PDT 2018
Sorry for the delay, now have access to an old laptop with Windows. When do you need this resolved?
Roger
Roger Bivand
Norwegian School of Economics
Bergen, Norway
Fra: Veronica Andreo
Sendt: mandag 17. september, 02.20
Emne: Re: [GRASS-stats] Error when starting grass from R (grass installed thru osgeo4w)
Til: Helmut Kudrnovsky
Kopi: grass-stats at lists.osgeo.org
Hi again,
So, I tested as suggested:
1. Open R console within OSGeo4W Shell,
2. library(rgrass7)
3. initGRASS(gisBase = 'C:/OSGeo4W64/apps/grass/grass-7.4.0', gisDbase = 'C:/Users/RETA/Documents/grassdata', location = 'nc_spm_08_grass7', mapset = 'user1', SG='elevation')
and I now get:
unused argument (gisDbase = 'C:/Users/RETA/Documents/grassdata')
anything else to test/set?
best,
Vero
El dom., 16 sept. 2018 a las 23:15, Helmut Kudrnovsky (<hellik at web.de<mailto:hellik at web.de>>) escribió:
>OK, thanks for confirming that OSGeo4W remains feasible for rgrass7; I don't
have access. Does usability >include initGRASS()? This would be most fragile
because environment variables are being set, and >condition on Windows and
OSGeo4W.
R within a GRASS session works quite well so far.
did a fresh svn up of
svn://r-forge.r-project.org/svnroot/spgrass<http://r-forge.r-project.org/svnroot/spgrass>
and quickly screened pkg\rgrass7\R\initGRASS.R:
e.g.
Sys.setenv(GRASS_PROJSHARE=paste(Sys.getenv("GISBASE"),
"\\proj", sep=""))
AFAIK at least the GRASS7.4.x line doesn't use anymore an own copy of the
PROJSHARE files; instead it uses the PROJ files itself; that's for all
platforms (linux, MacOS, MS Windows, ...).
e.g. in OSGeo4W 64bit it's defined as:
SET OSGEO4W_ROOT=C:\OSGeo4W64
set GRASS_PROJSHARE=%OSGEO4W_ROOT%\share\proj
only in the standalone installer, it's still defined as:
set GRASS_PROJSHARE=%GISBASE%\share\proj
because it's bundled in the installer.
e.g.
Sys.setenv(PATH=paste(Sys.getenv("GISBASE"), "\\extrabin;",
Sys.getenv("PATH"), sep=""))
there is no C:\OSGeo4W64\apps\grass\grass-7.4.1, because all of the
dependencies etc are living e.g. in
C:\OSGeo4W64\bin, C:\OSGeo4W64\lib, ...
I'm not sure about this one:
[...]
Sys.setenv(GISBASE=gisBase)
if (missing(home)) home <- Sys.getenv("USERPROFILE")
[...]
Sys.setenv(GISRC=paste(Sys.getenv("HOME"), "\\.grassrc7", sep=""))
in winGRASS (standalone, OSGeo4W), the rc file lives in
C:\Users\YourUserName\AppData\Roaming\GRASS7 and not in %USERPROFILE%
and it seems around these lines:
[...]
Sys.setenv(GISRC="junk")
cat("GISDBASE:", getwd(), "\n", file=Sys.getenv("GISRC"))
cat("LOCATION_NAME: <UNKNOWN>", "\n", file=Sys.getenv("GISRC"),
append=TRUE)
cat("MAPSET: <UNKNOWN>", "\n", file=Sys.getenv("GISRC"),
append=TRUE)
gisrc <- ifelse (use_g.dirseps.exe, system(paste("g.dirseps.exe -g",
shQuote(Sys.getenv("GISRC"))), intern=TRUE),
Sys.getenv("GISRC"))
[...]
initGRASS gets in trouble in OSGeo4W.
-----
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Stats-f4049448.html
_______________________________________________
grass-stats mailing list
grass-stats at lists.osgeo.org<mailto:grass-stats at lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/grass-stats
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-stats/attachments/20180919/aeceb4b3/attachment.html>
More information about the grass-stats
mailing list