[GRASS-stats] Using d.mon and friends in GRASS 7 from script

Roger Bivand Roger.Bivand at nhh.no
Mon Apr 25 10:22:50 PDT 2016


Hi,

A Linux user of rgrass7 (7.0.3) has fould that the GRASS initialisation in 
rgrass7::initGRASS() does not permit the successful use of d.mon and 
friends. One problem already found is that initGRASS does not set the 
GRASS_PYTHON environment variable. When this is corrected manually, d.mon 
start=wx0 seems to work, but no window appears. Lines are added to GISRC, 
but no PID, so:

> Sys.setenv("GRASS_PYTHON"="/usr/bin/python")
> execGRASS("g.gui", ui="wxpython")
Launching <wxpython> GUI in the background, please wait...

That did work, the windows appeared, but the graphics window doesn't seem 
to be seen by d.mon.

> execGRASS("g.gisenv", flags="n")
GISDBASE=/tmp/RtmpJ9bb8r
LOCATION_NAME=file2fe95902e5af
MAPSET=file2fe926c02e7c
GRASS_GUI=text
> execGRASS("d.mon", flags="l")
No monitors running
> execGRASS("d.mon", start="wx0")
> execGRASS("g.gisenv", flags="n")
GISDBASE=/tmp/RtmpJ9bb8r
LOCATION_NAME=file2fe95902e5af
MAPSET=file2fe926c02e7c
GRASS_GUI=text
MONITOR_WX0_ENVFILE=/tmp/RtmpJ9bb8r/file2fe95902e5af/file2fe926c02e7c/.tmp/localhost.localdomain/12758.0.env
MONITOR_WX0_CMDFILE=/tmp/RtmpJ9bb8r/file2fe95902e5af/file2fe926c02e7c/.tmp/localhost.localdomain/12758.0.cmd
MONITOR=wx0
MONITOR_WX0_MAPFILE=/tmp/RtmpJ9bb8r/file2fe95902e5af/file2fe926c02e7c/.tmp/localhost.localdomain/12758.0.ppm
> execGRASS("d.mon", flags="l")
wx0
List of running monitors:
> execGRASS("d.mon", stop="wx0")
Error in execGRASS("d.mon", stop = "wx0") : The command:
d.mon stop=wx0
produced an error (1) during execution:
ERROR: PID file not found

Does anyone have any insights?

Roger

-- 
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 grass-stats mailing list