[GRASS-dev] GRASS_RENDER_IMMEDIATE in GRASS7

Martin Landa landa.martin at gmail.com
Sun Jul 17 15:58:33 EDT 2011


Hi,

2011/7/17 Martin Landa <landa.martin at gmail.com>:

[...]

>> Some of these environment variables might be better off as GRASS
>> variables; this would allow them to be controlled through modules,
>> rather than requiring the user to set them on the command line.
>
> That's right, some of them started as shell variables (GRASS_GUI) and
> later became GRASS variables (e.g. GRASS_GUI) without changing the
> variable name. Manual page variables.html became quite outdated by
> time. I would incline to minimalize shell variables if possible. Could
> we collect minimal group of shell variable which we need?
>
>> The downside is that scripts (and wxGUI) would need to create a
>> temporary $GISRC file rather than just using a modified environment.

It's also related to the recently re-implemented d.mon in G7. Monitors
in G6 are basically executables running on the background. I would not
personally backport these monitors to G7. Currently d.mon G7 creates
supporting files which are tracked as GRASS variable, eg.

d.mon wx0
g.gisenv -n | grep MONITOR_wx0
MONITOR_wx0_ENVFILE=/home/martin/grassdata/nc_spm_08/PERMANENT/.tmp/pierre/7059.0.env
MONITOR_wx0_MAPFILE=/home/martin/grassdata/nc_spm_08/PERMANENT/.tmp/pierre/7059.0.ppm
MONITOR_wx0_PID=7060
MONITOR_wx0_CMDFILE=/home/martin/grassdata/nc_spm_08/PERMANENT/.tmp/pierre/7059.0.cmd

In this case MONITOR_wx0_MAPFILE defines GRASS_PNGFILE.

File MONITOR_wx0_ENVFILE contains rendering-related shell variables

cat /home/martin/grassdata/nc_spm_08/PERMANENT/.tmp/pierre/7059.0.env
GRASS_WIDTH=698
GRASS_REGION=n-s resol: 25.328330; n-s resol3: 10; rows: 533; north:
228500.0; t-b resol: 1; zone: 0; bottom: 0; rows3: 1350; west:
630000.0; top: 1; cols: 698; cols3: 1500; depths: 1; e-w resol:
21.489971; proj: 99; e-w resol3: 10; east: 645000.0; south: 215000.0;
GRASS_TRUECOLOR=TRUE
GRASS_PNG_READ=TRUE
GRASS_BACKGROUNDCOLOR=FFFFFF
GRASS_COMPRESSION=0
GRASS_TRANSPARENT=TRUE
GRASS_HEIGHT=533

and MONITOR_wx0_CMDFILE contains list of display commands (used by
`d.mon -c` or `d.redraw`).

d.mon stop=wx0

removes these GRASS variables, similarly work other display drivers,
eg. `d.mon start=ps output=nc.ps`

This solution is completely based on usage supporting files which
defines output and env variables for rendering. Downside is that env
file is read everytime when is D_open_driver() called, ie. when
running d.* command.

Martin

-- 
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa


More information about the grass-dev mailing list