Using GRASS addons in R on Windows

classic Classic list List threaded Threaded
29 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Using GRASS addons in R on Windows

Roger Bivand
On Tue, 12 Jan 2016, Roger Bivand wrote:

> On Tue, 12 Jan 2016, Markus Neteler wrote:
>
>>  On Tue, Jan 12, 2016 at 8:24 PM, Roger Bivand <[hidden email]> wrote:
>> >  On Tue, 12 Jan 2016, Helmut Kudrnovsky wrote:
>> > >  confirmed, it works now.
>> > >  great, thanks!
>> > >
>> >  OK, thanks, as I've also made progress on the other problem (using
>> >  temporary
>> >  SQLite files for vector transfer under Windows), I've submitted to CRAN.
>> >  Anyone who installed the 0.1-4 versions for testing will need to install
>> >  the
>> >  CRAN version when/if it appears.
>>
>>  That's great, thanks for discovering and solving!
>
> On CRAN now (source package), Windows binary will follow. Thanks for help in
> checking - if the *.py scripts all have *.bat in the locations checked, they
> should be found.
>
> Does the order of the system and user bin folders matter? Should we care if
> the addons are duplicated?

Maybe released too fast, unfortunately. For use of R in a running GRASS
session with addons, this version should be fine.

However, it will not work for initGRASS(), which does not set
GRASS_ADDON_BASE or GRASS_ADDON_PATH.

Where should I look to see where the correct values are stored on Unix
(Linux and OSX?) and Windows? I see: GRASS_ADDON_BASE as GNU/Linux is
$HOME/.grass7/addons, on MS Windows $APPDATA\GRASS7\addons in:

https://grass.osgeo.org/grass70/manuals/variables.html

Is %APPDATA% a predictable location on Windows?

What happens if the user sets prefix= in g.extension?

On Windows, adding GRASS_ADDON_BASE\bin to the PATH is sufficient (because
all scripts in /scripts have a matching *.bat in /bin. On Unix, we need
both /scripts (for Python scripts) and /bin for compiled extensions. Do we
need toolboxes?

Best wishes,

Roger

>
> Best wishes,
>
> Roger
>
>>
>>  Markus
>>
>
>

--
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 91 00
e-mail: [hidden email]
http://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
http://depsy.org/person/434412
_______________________________________________
grass-stats mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-stats
Roger Bivand
NHH Norwegian School of Economics, Bergen, Norway
Reply | Threaded
Open this post in threaded view
|

Re: Using GRASS addons in R on Windows

Helmut Kudrnovsky
>
>Is %APPDATA% a predictable location on Windows?

yes, %APPDATA% is predictable on Windows.

we set it e.g. in the winGRASS standalone installer here:

https://trac.osgeo.org/grass/browser/grass/branches/releasebranch_7_0/mswindows/GRASS-Installer.nsi.tmpl#L743 

and on other places in the code.

>Where should I look to see where the correct values are stored on Unix
>(Linux and OSX?) and Windows? I see: GRASS_ADDON_BASE as GNU/Linux is
>$HOME/.grass7/addons, on MS Windows $APPDATA\GRASS7\addons in:
>
>https://grass.osgeo.org/grass70/manuals/variables.html

maybe some hints:

https://trac.osgeo.org/grass/browser/grass/branches/releasebranch_7_0/scripts/g.extension/g.extension.py#L1053

best regards
Helmut
Reply | Threaded
Open this post in threaded view
|

Re: Using GRASS addons in R on Windows

Roger Bivand
On Wed, 13 Jan 2016, Helmut Kudrnovsky wrote:

>>> Is %APPDATA% a predictable location on Windows?
>
> yes, %APPDATA% is predictable on Windows.

Thanks. I've committed changes to R-forge, which seem to work for me for
Linux and Windows. The updated draft Windows binary is at:

http://win-builder.r-project.org/KJJJkeazt7Sw/rgrass7_0.1-5.zip

Could users of initGRASS() please check that the environment variables are
set correctly for addons? Some other changes (removing code not relevant
for GRASS7) were also made.

Best wishes,

Roger

>
> we set it e.g. in the winGRASS standalone installer here:
>
> https://trac.osgeo.org/grass/browser/grass/branches/releasebranch_7_0/mswindows/GRASS-Installer.nsi.tmpl#L743 
>
> and on other places in the code.
>
>> Where should I look to see where the correct values are stored on Unix
>> (Linux and OSX?) and Windows? I see: GRASS_ADDON_BASE as GNU/Linux is
>> $HOME/.grass7/addons, on MS Windows $APPDATA\GRASS7\addons in:
>>
>> https://grass.osgeo.org/grass70/manuals/variables.html
>
> maybe some hints:
>
> https://trac.osgeo.org/grass/browser/grass/branches/releasebranch_7_0/scripts/g.extension/g.extension.py#L1053
>
>
>
>
>
> -----
> best regards
> Helmut
> --
> View this message in context: http://osgeo-org.1560.x6.nabble.com/Using-GRASS-addons-in-R-on-Windows-tp5244411p5244927.html
> Sent from the Grass - Stats mailing list archive at Nabble.com.
> _______________________________________________
> grass-stats mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/grass-stats

--
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 91 00
e-mail: [hidden email]
http://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
http://depsy.org/person/434412
_______________________________________________
grass-stats mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-stats
Roger Bivand
NHH Norwegian School of Economics, Bergen, Norway
Reply | Threaded
Open this post in threaded view
|

Re: Using GRASS addons in R on Windows

Helmut Kudrnovsky
>Thanks. I've committed changes to R-forge, which seem to work for me for
>Linux and Windows. The updated draft Windows binary is at:
>
>http://win-builder.r-project.org/KJJJkeazt7Sw/rgrass7_0.1-5.zip

> utils:::menuInstallLocal()
Paket ‘rgrass7’ erfolgreich ausgepackt und MD5 Summen abgeglichen
>
> library(rgrass7)
Lade nötiges Paket: sp
Lade nötiges Paket: XML
GRASS GIS interface loaded with GRASS version: (GRASS not running)

from the https://cran.r-project.org/web/packages/rgrass7/rgrass7.pdf

Examples
## Not run:
initGRASS("/usr/bin/grass-7.0.0", home=tempdir())
initGRASS("C:/GRASS", home=tempdir())
## End(Not run)

as an used windows user I've tried first with Windows-typical backslash ;-)

initGRASS("C:\\Program Files\\GRASS GIS 7.1.svn", home=tempdir(), gisDbase="C:\\grassdata", location="nc_spm_08", mapset="user1")

> initGRASS("C:\Program Files\GRASS GIS 7.1.svn", home=tempdir(), location="C:\grassdata\nc_spm_08\", mapset="user1")
Fehler: '\P' ist eine unbekannte Escape-Sequenz in der Zeichenkette beginnend mit ""C:\P"
error: '\P' is an unkown escape sequence beginning with with ""C:\P"

then I tried double backslash

initGRASS("C:\\Program Files\\GRASS GIS 7.1.svn", home=tempdir(), gisDbase="C:\\grassdata", location="nc_spm_08", mapset="user1")

> initGRASS("C:\\Program Files\\GRASS GIS 7.1.svn", home=tempdir(), gisDbase="C:\\grassdata", location="nc_spm_08", mapset="user1")
gisdbase    C:/grassdata
location    nc_spm_08
mapset      user1
rows        6
columns     8
north       222800
south       222740
west        642590
east        642670
nsres       10
ewres       10
projection  +proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +no_defs +a=6378137 +rf=298.257222101
+towgs84=0.000,0.000,0.000 +to_meter=1

and the slash mentioned in the manual example

initGRASS("C:/Program Files/GRASS GIS 7.1.svn", home=tempdir(), gisDbase="C:/grassdata", location="nc_spm_08", mapset="user1")

> initGRASS("C:/Program Files/GRASS GIS 7.1.svn", home=tempdir(), gisDbase="C:/grassdata", location="nc_spm_08", mapset="user1")
gisdbase    C:/grassdata
location    nc_spm_08
mapset      user1
rows        6
columns     8
north       222800
south       222740
west        642590
east        642670
nsres       10
ewres       10
projection  +proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +no_defs +a=6378137 +rf=298.257222101
+towgs84=0.000,0.000,0.000 +to_meter=1

not sure what R's normal notation of MS windows paths are (slash or double backslash), maybe an addition to the manual would be worth?

will testing winGRASS modules and addons later.
best regards
Helmut
Reply | Threaded
Open this post in threaded view
|

Re: Using GRASS addons in R on Windows

Helmut Kudrnovsky
In reply to this post by Roger Bivand
>http://win-builder.r-project.org/KJJJkeazt7Sw/rgrass7_0.1-5.zip
>
>Could users of initGRASS() please check that the environment variables are
>set correctly for addons?

> sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=German_Austria.1252  LC_CTYPE=German_Austria.1252    LC_MONETARY=German_Austria.1252 LC_NUMERIC=C                  
[5] LC_TIME=German_Austria.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base    

other attached packages:
[1] rgrass7_0.1-5 XML_3.98-1.3  sp_1.2-2    

loaded via a namespace (and not attached):
[1] grid_3.2.3      lattice_0.20-33

> library(rgrass7)
Lade nötiges Paket: sp
Lade nötiges Paket: XML
GRASS GIS interface loaded with GRASS version: (GRASS not running)

> initGRASS("C:/Program Files/GRASS GIS 7.1.svn", home=tempdir(), gisDbase="C:/grassdata", location="nc_spm_08", mapset="user1")
gisdbase    C:/grassdata
location    nc_spm_08
mapset      user1
rows        6
columns     8
north       222800
south       222740
west        642590
east        642670
nsres       10
ewres       10
projection  +proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334
+lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +no_defs +a=6378137
+rf=298.257222101 +towgs84=0.000,0.000,0.000 +to_meter=1

> execGRASS("g.region", raster="elevation", align="elevation", flags="a")

> execGRASS("r.slope.aspect", elevation="elevation", slope="myslope", aspect="myaspect")

Expositions-Rasterkarte <myaspect> komplett.
Neigungs-Rasterkarte <myslope> komplett.
> execGRASS("r.roughness.vector", elevation="elevation", slope="myslope", aspect="myaspect", strength="vectorstrength")
----
Check if input files exist ...
----
Define default output names when not defined by user ...
----
Calculate compass aspect values ...
----
Calculate colatitude ...
----
Calculate direction cosines ...
----
Calculate sum of direction cosines ...
Calculating sum of X direction cosines ...

Calculating sum of Y direction cosines ...

Calculating sum of Z direction cosines ...

----
Calculate vector strength ...
----
Calculate inverted Fisher's K parameter ...
----
Result maps:
vectorstrength
elevation_fisher_1K_3x3
Calculations done.
----

> execGRASS("r.reclass.area", input="zipcodes", output="zipcode_larger2000ha", value=2000, mode="greater")
Generating a clumped raster file ...
Pass 1 of 2...

Generating renumbering scheme...

Pass 2 of 2...

r.clump komplett. 16 clumps.
Generating a reclass map with area size greater than or equal to
2000.000000 hectares...

Generating output raster map <zipcode_larger2000ha>...
>

it seems to work properly in:

R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

thanks!
best regards
Helmut
Reply | Threaded
Open this post in threaded view
|

Re: Using GRASS addons in R on Windows

Roger Bivand
On Wed, 13 Jan 2016, Helmut Kudrnovsky wrote:

>> http://win-builder.r-project.org/KJJJkeazt7Sw/rgrass7_0.1-5.zip
>>
>> Could users of initGRASS() please check that the environment variables are
>> set correctly for addons?
>
>> sessionInfo()
> R version 3.2.3 (2015-12-10)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
> Running under: Windows 7 x64 (build 7601) Service Pack 1
>
> locale:
> [1] LC_COLLATE=German_Austria.1252  LC_CTYPE=German_Austria.1252
> LC_MONETARY=German_Austria.1252 LC_NUMERIC=C
> [5] LC_TIME=German_Austria.1252
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
> [1] rgrass7_0.1-5 XML_3.98-1.3  sp_1.2-2
>
> loaded via a namespace (and not attached):
> [1] grid_3.2.3      lattice_0.20-33
>
>> library(rgrass7)
> Lade nötiges Paket: sp
> Lade nötiges Paket: XML
> GRASS GIS interface loaded with GRASS version: (GRASS not running)
>
>> initGRASS("C:/Program Files/GRASS GIS 7.1.svn", home=tempdir(),
>> gisDbase="C:/grassdata", location="nc_spm_08", mapset="user1")
> gisdbase    C:/grassdata
> location    nc_spm_08
> mapset      user1
> rows        6
> columns     8
> north       222800
> south       222740
> west        642590
> east        642670
> nsres       10
> ewres       10
> projection  +proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334
> +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +no_defs +a=6378137
> +rf=298.257222101 +towgs84=0.000,0.000,0.000 +to_meter=1
>
>> execGRASS("g.region", raster="elevation", align="elevation", flags="a")
>
>> execGRASS("r.slope.aspect", elevation="elevation", slope="myslope",
>> aspect="myaspect")
>
> Expositions-Rasterkarte <myaspect> komplett.
> Neigungs-Rasterkarte <myslope> komplett.
>> execGRASS("r.roughness.vector", elevation="elevation", slope="myslope",
>> aspect="myaspect", strength="vectorstrength")
> ----
> Check if input files exist ...
> ----
> Define default output names when not defined by user ...
> ----
> Calculate compass aspect values ...
> ----
> Calculate colatitude ...
> ----
> Calculate direction cosines ...
> ----
> Calculate sum of direction cosines ...
> Calculating sum of X direction cosines ...
>
> Calculating sum of Y direction cosines ...
>
> Calculating sum of Z direction cosines ...
>
> ----
> Calculate vector strength ...
> ----
> Calculate inverted Fisher's K parameter ...
> ----
> Result maps:
> vectorstrength
> elevation_fisher_1K_3x3
> Calculations done.
> ----
>
>> execGRASS("r.reclass.area", input="zipcodes",
>> output="zipcode_larger2000ha", value=2000, mode="greater")
> Generating a clumped raster file ...
> Pass 1 of 2...
>
> Generating renumbering scheme...
>
> Pass 2 of 2...
>
> r.clump komplett. 16 clumps.
> Generating a reclass map with area size greater than or equal to
> 2000.000000 hectares...
>
> Generating output raster map <zipcode_larger2000ha>...
>>
>
> it seems to work properly in:
>
> R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"
> Copyright (C) 2015 The R Foundation for Statistical Computing
> Platform: x86_64-w64-mingw32/x64 (64-bit)
>
> thanks!
>
Thanks very much for checking! Could someone please report on status for
OSX, and corroborate my finding that it works for my source installed
GRASS on Fedora - other Linux variants and installation mechanisms (Ubuntu
etc. installed binary?? may vary.

Best wishes,

Roger

>
>
> -----
> best regards
> Helmut
> --
> View this message in context: http://osgeo-org.1560.x6.nabble.com/Using-GRASS-addons-in-R-on-Windows-tp5244411p5244989.html
> Sent from the Grass - Stats mailing list archive at Nabble.com.
> _______________________________________________
> grass-stats mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/grass-stats
--
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 91 00
e-mail: [hidden email]
http://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
http://depsy.org/person/434412
_______________________________________________
grass-stats mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-stats
Roger Bivand
NHH Norwegian School of Economics, Bergen, Norway
Reply | Threaded
Open this post in threaded view
|

Re: Using GRASS addons in R on Windows

pvanbosgeo


On 13-01-16 14:42, Roger Bivand wrote:
On Wed, 13 Jan 2016, Helmut Kudrnovsky wrote:

http://win-builder.r-project.org/KJJJkeazt7Sw/rgrass7_0.1-5.zip

Could users of initGRASS() please check that the environment variables are
set correctly for addons?

sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=German_Austria.1252  LC_CTYPE=German_Austria.1252 LC_MONETARY=German_Austria.1252 LC_NUMERIC=C [5] LC_TIME=German_Austria.1252
attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base
other attached packages:
[1] rgrass7_0.1-5 XML_3.98-1.3  sp_1.2-2
loaded via a namespace (and not attached):
[1] grid_3.2.3      lattice_0.20-33

library(rgrass7)
Lade nötiges Paket: sp
Lade nötiges Paket: XML
GRASS GIS interface loaded with GRASS version: (GRASS not running)

initGRASS("C:/Program Files/GRASS GIS 7.1.svn", home=tempdir(),
gisDbase="C:/grassdata", location="nc_spm_08", mapset="user1")
gisdbase    C:/grassdata location    nc_spm_08 mapset      user1 rows        6 columns     8 north       222800 south       222740 west        642590 east        642670 nsres       10 ewres       10 projection  +proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334
+lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +no_defs +a=6378137
+rf=298.257222101 +towgs84=0.000,0.000,0.000 +to_meter=1
execGRASS("g.region", raster="elevation", align="elevation", flags="a")

execGRASS("r.slope.aspect", elevation="elevation", slope="myslope",
aspect="myaspect")

Expositions-Rasterkarte <myaspect> komplett.
Neigungs-Rasterkarte <myslope> komplett.
execGRASS("r.roughness.vector", elevation="elevation", slope="myslope",
aspect="myaspect", strength="vectorstrength")
----
Check if input files exist ...
----
Define default output names when not defined by user ...
----
Calculate compass aspect values ...
----
Calculate colatitude ...
----
Calculate direction cosines ...
----
Calculate sum of direction cosines ...
Calculating sum of X direction cosines ...

Calculating sum of Y direction cosines ...

Calculating sum of Z direction cosines ...

----
Calculate vector strength ...
----
Calculate inverted Fisher's K parameter ...
----
Result maps:
vectorstrength
elevation_fisher_1K_3x3
Calculations done.
----

execGRASS("r.reclass.area", input="zipcodes",
output="zipcode_larger2000ha", value=2000, mode="greater")
Generating a clumped raster file ...
Pass 1 of 2...

Generating renumbering scheme...

Pass 2 of 2...

r.clump komplett. 16 clumps.
Generating a reclass map with area size greater than or equal to
2000.000000 hectares...

Generating output raster map <zipcode_larger2000ha>...


it seems to work properly in:

R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

thanks!


Thanks very much for checking! Could someone please report on status for OSX, and corroborate my finding that it works for my source installed GRASS on Fedora - other Linux variants and installation mechanisms (Ubuntu etc. installed binary?? may vary.

Best wishes,

Roger


Hi Roger,

thanks for this update, great! I just checked for Ubuntu 14.04. When running R from within a GRASS session, I can now use installed GRASS addons. Great! initGRASS doesn't seem to work though (I never use it, so if I am overlooking something, please let me know). See below:

> library(rgrass7)
> initGRASS("/usr/local/grass7", home=tempdir())
sh: 1: g.gisenv: not found
sh: 1: g.gisenv: not found
sh: 1: g.gisenv: not found
sh: 1: g.gisenv: not found
sh: 1: g.gisenv: not found
sh: 1: g.version: not found
Error in system(paste("g.version", get("addEXE", envir = .GRASS_CACHE),  : 
  error in running command
> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.3 LTS

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C    
 [3] LC_TIME=nl_NL.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=nl_NL.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=nl_NL.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
 [11] LC_MEASUREMENT=nl_NL.UTF-8 LC_IDENTIFICATION=C       
attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     
other attached packages:
[1] rgrass7_0.1-5 XML_3.98-1.3  sp_1.2-1     
loaded via a namespace (and not attached):
[1] grid_3.2.2      lattice_0.20-33
Best wishes,

Paulo









-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Using-GRASS-addons-in-R-on-Windows-tp5244411p5244989.html
Sent from the Grass - Stats mailing list archive at Nabble.com.
_______________________________________________
grass-stats mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-stats



_______________________________________________
grass-stats mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-stats


_______________________________________________
grass-stats mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-stats
Reply | Threaded
Open this post in threaded view
|

Re: Using GRASS addons in R on Windows

Helmut Kudrnovsky
>> library(rgrass7)
>> initGRASS("/usr/local/grass7", home=tempdir())
>sh: 1: g.gisenv: not found
>sh: 1: g.gisenv: not found
>sh: 1: g.gisenv: not found
>sh: 1: g.gisenv: not found
>sh: 1: g.gisenv: not found
>sh: 1: g.version: not found
>Error in system(paste("g.version", get("addEXE", envir = .GRASS_CACHE),  :
>  error in running command

just a quick test on windows here:

> library(rgrass7)
Lade nötiges Paket: sp
Lade nötiges Paket: XML
GRASS GIS interface loaded with GRASS version: (GRASS not running)

> initGRASS("C:/Program Files/GRASS GIS 7.1.svn", home=tempdir())
gisdbase    C:/Users/xxxxx~1/AppData/Local/Temp/Rtmpk93Gnb
location    file55c44229c0
mapset      file55c5711580b
rows        1
columns     1
north       1
south       0
west        0
east        1
nsres       1
ewres       1
projection  NA

is your GRASS really living in /usr/local/grass7 ?
best regards
Helmut
Reply | Threaded
Open this post in threaded view
|

Re: Using GRASS addons in R on Windows

pvanbosgeo


On 13-01-16 18:11, Helmut Kudrnovsky wrote:

>>> library(rgrass7)
>>> initGRASS("/usr/local/grass7", home=tempdir())
>> sh: 1: g.gisenv: not found
>> sh: 1: g.gisenv: not found
>> sh: 1: g.gisenv: not found
>> sh: 1: g.gisenv: not found
>> sh: 1: g.gisenv: not found
>> sh: 1: g.version: not found
>> Error in system(paste("g.version", get("addEXE", envir = .GRASS_CACHE),  :
>>   error in running command
> just a quick test on windows here:
>
>> library(rgrass7)
> Lade nötiges Paket: sp
> Lade nötiges Paket: XML
> GRASS GIS interface loaded with GRASS version: (GRASS not running)
>
>> initGRASS("C:/Program Files/GRASS GIS 7.1.svn", home=tempdir())
> gisdbase    C:/Users/xxxxx~1/AppData/Local/Temp/Rtmpk93Gnb
> location    file55c44229c0
> mapset      file55c5711580b
> rows        1
> columns     1
> north       1
> south       0
> west        0
> east        1
> nsres       1
> ewres       1
> projection  NA
>
> is your GRASS really living in /usr/local/grass7 ?

You're right, sorry, it should have  been
"/usr/local/grass7/grass-7.1.svn". Now I get:

> initGRASS("/usr/local/grass7/grass-7.1.svn", home=tempdir())
gisdbase    /tmp/Rtmp11YxrX
location    file17b23d9387e8
mapset      file17b239be5145
rows        1
columns     1
north       1
south       0
west        0
east        1
nsres       1
ewres       1
projection  NA

Working with addons now work as well. So for Ubuntu 14.04 and GRASS 7.1
compiled from trunk I can now confirm it works.

Thanks Helmut for the follow up and of course big thanks to Roger Bivand
for new version of rgrass7!

Best wishes

Paulo

>
>
> -----
> best regards
> Helmut
> --
> View this message in context: http://osgeo-org.1560.x6.nabble.com/Using-GRASS-addons-in-R-on-Windows-tp5244411p5245064.html
> Sent from the Grass - Stats mailing list archive at Nabble.com.
> _______________________________________________
> grass-stats mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/grass-stats

_______________________________________________
grass-stats mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-stats
12