[R-sig-Geo] spgrass6 and InitGrass

Tomislav Hengl hengl at spatial-analyst.net
Thu Oct 6 15:23:15 CEST 2011


Op 6-10-2011 15:19, Roger Bivand schreef:
> On Thu, 6 Oct 2011, Tomislav Hengl wrote:
>
>>
>> I'm having problems using GRASS 6.4.1 from R under windows 7. I've
>> installed GRASS and then loaded spgrass6 and tried:
>>
>>> library(spgrass6)
>> Loading required package: XML
>> GRASS GIS interface loaded with GRASS version: (GRASS not running)
>>> GRASS <- shortPathName(utils::readRegistry("SOFTWARE\\WOW6432NODE\\GRASS
>> 6.4.1")$InstallPath)
>> > GRASS
>> [1] "C:\\PROGRA~2\\GRASS6~1.1"
>> > initGRASS(gisBase=GRASS, home=tempdir())
>> Error in initGRASS(gisBase = GRASS, home = tempdir()) :
>> Platform variant not supported
>
> This means that we need to check deeper. What do:
>
> .Platform$OS.type
> Sys.getenv("OSTYPE")
> library(spgrass6)
> get("SYS", envir=spgrass6:::.GRASS_CACHE)
>
> report? If the first is the string "windows", and the second is "", the
> internal variable get("SYS", envir=spgrass6:::.GRASS_CACHE) is set to
> "WinNat". I suspect that one or other of these doesn't hold, and that
> SYS isn't being set to "WinNat" - on OSX and Linux, it is set to "unix";
> "msys" and "cygwin" also exist, but are not supported for initGRASS(). I
> only have access (now) to 32-bit XP.

I get:

 > .Platform$OS.type
[1] "windows"
 > Sys.getenv("OSTYPE")
    OSTYPE
"US_W764"
 > library(spgrass6)
Loading required package: XML
GRASS GIS interface loaded with GRASS version: (GRASS not running)
 > get("SYS", envir=spgrass6:::.GRASS_CACHE)
[1] ""

I could also try installing 32-bit GRASS GIS....

>
> Roger
>
>
>>
>> > paste(R.version$version.string, Sys.info()[["sysname"]],
>> Sys.info()[["release"]])
>> [1] "R version 2.12.2 (2011-02-25) Windows 7 x64"
>>> sessionInfo()[["otherPkgs"]][["spgrass6"]][["Version"]]
>> [1] "0.7-4"
>>
>> (sorry Roger, it probably means that you have to update the package :(
>>
>> T. Hengl
>> http://www.wewur.wur.nl/popups/vcard.aspx?id=HENGL001
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>



More information about the R-sig-Geo mailing list