[R-sig-Geo] rgrass7 : Error in parseGRASS

Roger Bivand Roger.Bivand at nhh.no
Tue Nov 22 14:30:09 CET 2016


On Tue, 22 Nov 2016, Michael DELORME wrote:

> Thanks for replying
>
> Here is a reproducible example (change your GRASS directory of course) :
>
> library(rgrass7)
> library(sp)
> initGRASS("C:/OSGeo4W64/apps/grass/grass-7.0.5", home = tempdir(),
> override = TRUE)
> data(meuse)
> coordinates(meuse) <- ~x+y
> writeVECT(meuse, "meuse")
> execGRASS("v.db.addcolumn", map = "meuse", columns = "area_m2 double
> precision")

This appears to run correctly on Windows 7 with GRASS 7.0.5 Windows 
stand-alone. Do you need to use OSGeo4W - the internal logic used for 
finding out where the different versions keep their executables and batch 
files varies?

What does traceback() say after the error? The error comes from 
parseGRASS("v.db.addcolumn") - the XML error comes from not being able to 
read the output of v.db.addcolumn<.ext> --interface-description where 
<.ext> may be .exe or .bat I think.

Roger

>
> I get :
> Error : XML content does not seem to be XML: 'The specified path was not
> found.'
> In addition: Warning message:
> running command 'v.db.addcolumn.bat --interface-description' had status 1
> Error in parseGRASS(cmd, legacyExec = legacyExec) :
>  v.db.addcolumn not parsed
>
> Other execGRASS commands (like r.neighbors, r.mapcalc,..)  work fine,
> but some other (r.mask) fail with a similar XML error.
>
> All commands work fine when used from the GRASS shell...
>
> What is this XML error ?
> Thanks
>
> Le 22/11/2016 09:34, Roger Bivand a écrit :
>> On Tue, 22 Nov 2016, Michael DELORME wrote:
>>
>>> Dear list,
>>>
>>> Using rgrass7 on Windows7 with GRASS 7.0.5 (OSGeo distribution), I get
>>> the following error :
>>
>> Please always try to provide a reproducible example using a standard
>> data set. In addition, the output of traceback() following the error
>> would be helpful. Are you running R inside GRASS, or using R to
>> initiate GRASS?
>>
>> Consider using the grass-stats list:
>>
>> https://lists.osgeo.org/mailman/listinfo/grass-stats
>>
>> as it is more likely to yield results, but there also provide an
>> example that anyone can reproduce. The example should avoid loading
>> other packages, and should be run from the R console (not, say, RStudio).
>>
>> Roger
>>
>>
>>
>>>
>>>> execGRASS("v.db.addcolumn", map = "result_v", columns = "area_m2
>>>> double precision")
>>> Error : XML content does not seem to be XML: 'Le chemin d'accés
>>> spécifié est introuvable.' In addition: Warning message: running
>>> command 'v.db.addcolumn.bat --interface-description' had status 1
>>> Error in parseGRASS(cmd, legacyExec = legacyExec) :
>>>  v.db.addcolumn not parsed
>>>
>>>
>>> and a similar one for r.mask :
>>>
>>>> execGRASS("r.mask", raster = "map")
>>> Error : XML content does not seem to be XML: 'Le chemin d'accés
>>> spécifié est introuvable.'
>>> In addition: Warning message:
>>> running command 'r.mask.bat --interface-description' had status 1
>>> Error in parseGRASS(cmd, legacyExec = legacyExec) : r.mask not parsed
>>>
>>>
>>> whereas most other execGRASS command I tried work as expected.
>>> Any idea ?
>>> Thanks in advance
>>>
>>> Here is my session info :
>>>
>>>> sessionInfo()
>>> R version 3.3.1 (2016-06-21)
>>> Platform: x86_64-w64-mingw32/x64 (64-bit)
>>> Running under: Windows 7 x64 (build 7601) Service Pack 1
>>>
>>> locale:
>>> [1] LC_COLLATE=French_France.1252  LC_CTYPE=French_France.1252 
>>> LC_MONETARY=French_France.1252 LC_NUMERIC=C [5]
>>> LC_TIME=French_France.1252
>>> attached base packages:
>>> [1] parallel  stats     graphics  grDevices utils     datasets 
>>> methods   base
>>> other attached packages: [1] rgrass7_0.1-9 XML_3.98-1.4 beepr_1.2
>>> raster_2.5-8 sp_1.2-3 RPostgreSQL_0.4-1 DBI_0.5-1
>>>
>>> loaded via a namespace (and not attached): [1] magrittr_1.5
>>> tools_3.3.1 audio_0.1-5 Rcpp_0.12.7 stringi_1.1.2 grid_3.3.1
>>> stringr_1.1.0 lattice_0.20-34 [9] fortunes_1.5-3
>>>
>>>
>>>
>>>     [[alternative HTML version deleted]]
>>>
>>> _______________________________________________
>>> R-sig-Geo mailing list
>>> R-sig-Geo at r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
> -- 
> *Michaël DELORME*
> Administrateur de données, chargé de projet en géomatique
> Service régional de l'information statistique, économique et territoriale
> Direction régionale de l'alimentation, de l'agriculture et de la forêt
> Auvergne-Rhône-Alpes
> Site de Lyon
> 165 rue Garibaldi – BP 3202 – 69401 LYON cedex 03
> 04 78 63 34 21
>
> Pour écrire au service :
> DRAAF Auvergne-Rhône-Alpes – SRISET
> 16B rue Aimé Rudel – BP 45 – 63370 LEMPDES
>
> http://www.draaf.auvergne-rhone-alpes.agriculture.gouv.fr/
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

-- 
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: Roger.Bivand at nhh.no
http://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
http://depsy.org/person/434412


More information about the R-sig-Geo mailing list