[GRASS-user] Fwd: Using g.extension in with rgrass7 in R

James Duffy james.philip.duffy at gmail.com
Wed May 3 08:26:36 PDT 2017


Solved.

I found that closing RStudio and then installing GRASS extensions, and
reopening RStudio afterwards solved the issue. Solution described here
<http://osgeo-org.1560.x6.nabble.com/GRASS-GIS-7-0-stable-and-R-integration-issue-td5281770.html>
.

---------- Forwarded message ----------
From: James Duffy <james.philip.duffy at gmail.com>
Date: 3 May 2017 at 14:44
Subject: Using g.extension in with rgrass7 in R
To: grass-user <grass-user at lists.osgeo.org>


Hello,

I'm trying to use GRASS in RStudio using the 'rgrass7' pacakge.

So far I have:











*library(rgrass7)initGRASS(gisBase =
"C:/OSGeo4W64/apps/grass/grass-7.3.svn",          gisDbase =
"C:/Sandbox/RGRASS/",          location = "TEST", mapset =
"MAP1",override=TRUE)in.rast <-
"C:/Users/James/Desktop/15m_site2/subset_output/15m_site2_subset_ortho.tif"execGRASS("r.in.gdal",
flags="o", parameters=list(input=in.rast, output="ortho"))*
Which works fine!

However, when I want to install an extension with:



*execGRASS("g.extension", parameters=list(extension="i.segment.uspo",
operation="add")) *
I get the following error:



















*Downloading precompiled GRASS Addons <i.segment.uspo>...ERROR: Variable
'LOCATION_NAME' not setERROR: Variable 'LOCATION_NAME' not setERROR:
Variable 'LOCATION_NAME' not setTraceback (most recent call last):  File
"C:/OSGeo4W64/apps/grass/grass-7.3.svn/scripts/g.extension.py
<http://g.extension.py>", line 1737, in <module>    sys.exit(main())  File
"C:/OSGeo4W64/apps/grass/grass-7.3.svn/scripts/g.extension.py
<http://g.extension.py>", line 1716, in main
install_extension(source=source, url=url, xmlurl=xmlurl)  File
"C:/OSGeo4W64/apps/grass/grass-7.3.svn/scripts/g.extension.py
<http://g.extension.py>", line 702, in install_extension    blist =
install_extension_xml(xmlurl, mlist)  File
"C:/OSGeo4W64/apps/grass/grass-7.3.svn/scripts/g.extension.py
<http://g.extension.py>", line 922, in install_extension_xml
write_xml_modules(xml_file, tree)  File
"C:/OSGeo4W64/apps/grass/grass-7.3.svn/scripts/g.extension.py
<http://g.extension.py>", line 601, in write_xml_modules    libgis_revison
= grass.version()['libgis_revision']KeyError: 'libgis_revision'Warning
message:running command 'g.extension.bat extension=i.segment.uspo
operation=add' had status 1*

Can anyone tell me where I have to set the 'LOCATION_NAME' please?

Kind regards

James

-- 
*James Duffy*
PhD Researcher
Environment and Sustainability Institute
Penryn Campus
University of Exeter
Penryn
Cornwall
TR10 9FE



-- 
*James Duffy*
PhD Researcher
Environment and Sustainability Institute
Penryn Campus
University of Exeter
Penryn
Cornwall
TR10 9FE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20170503/36cee4de/attachment.html>


More information about the grass-user mailing list