Skip to content
Prev 28262 / 29559 Next

Need help using GRASS within R - error when running the script for a second time

Dear Roger,

Sorry for cross-posting.
As you invite me, I'm going to post my case on https://github.com/rsbivand/rgrass7/issues.

Just a short comment to yours: if the reason you give is the right one, I don't understand why the script works the first time but not the second time. In your hypothesis, I guess it shouldn't work at all.

Best regards,
Lo?c

De : Roger Bivand <Roger.Bivand at nhh.no>
Envoy? : mardi 7 juillet 2020 20:20
? : Lo?c Val?ry <lvalery at outlook.fr>
Cc?: Micha Silver <tsvibar at gmail.com>; r-sig-geo at r-project.org <r-sig-geo at r-project.org>; grass-user <grass-user at lists.osgeo.org>
Objet : Re: [R-sig-Geo] [R] Need help using GRASS within R - error when running the script for a second time 
?
Please do not cross-post between lists, because few are likely to 
subscribe to both. Choose rather to post only to the list likely to 
include people using R and GRASS:

http://lists.osgeo.org/mailman/listinfo/grass-stats

Further, please post plain text only - I missed your earlier post to 
grass-user because it was scrubbed as HTML (or maybe Micha's reply).

Once resolved, you might report back on grass-user and R-sig-geo on the 
findings.

Briefly, it looks as though you are caught in the transition in sp/rgdal 
and sf from Proj4 to WKT2-2019 CRS, and similar changes in Grass. Grass 
7.8 and R packages may be installed with old PROJ/GDAL or new PROJ/GDAL. 
So far, nobody knows how to use g.proj and siblings sensibly in the R 
context. Most likely, using the wkt= parameter when the object in R has a 
WKT2 representation is going to be much more secure than passing a proj4= 
string, but wkt= takes a file name or standard input.

I would invite discussion in an issue on:

https://github.com/rsbivand/rgrass7/issues

with use cases (platform-independent).

Roger
On Tue, 7 Jul 2020, Lo?c Val?ry wrote: