[GRASS-dev] start grass with only initializing the environment

Rainer M Krug Rainer at krugs.de
Mon Jul 15 08:44:35 PDT 2013


Hi

During the recent useR conference I had a discussion with Roger Bivand
about the usage of GRASS from R on a Mac. I got it to work, but I
manually had to adjust library paths as these depend on the way GRASS is
installed (framework, homebrew, MacPorts, which version of GRASS).

So to get GRASS 7 to work from within R, it was required to identify the
paths of the libraries by going through the grass startup script. AS
mentioned above, these paths are not easily portable and to include in
the the spgrass6 startup mechanism.

Therefore the idea occurred, if it would be possible to use the grass
startup script to only set the environmental variables to be able to run
the grass commands.

As other applications do set these environmental variables as well
(cluster, http://osgeo.org/wiki/GRASS_and_Shell , ...) this would be of
wider use the simply when linking R and GRASS.

I would therefore suggest an additional startup argument for grass,
which only sets the environmental variables, including library paths,
so that GRASS commands can be executed afterwards, and if the
LOCATION_NAME and MAPSET are not provided, they will be null and *have
to be set manualy afterwards*. 
This could e.g. have the name "-noui" indicating that no ui will be
started. 

I think this would be a useful addition and make GRASS easier to use
from other programs via scripting.

Cheers,

Rainer

-- 
Rainer M. Krug

email: RMKrug<at>gmail<dot>com



More information about the grass-dev mailing list