1displaydrivers(1)             Grass User's Manual            displaydrivers(1)
2
3
4

Display drivers

6       The current command line rendering mechanism is direct rendering into a
7       file. The driver is  selected  by  setting  the  GRASS_RENDER_IMMEDIATE
8       variable or by running d.mon module.
9
10       List of available display drivers:
11
12           ·   Cairo driver
13
14           ·   PNG driver
15
16           ·   PS driver (Postscript)
17
18           ·   HTMLMAP driver
19

NOTES

21   GRASS_RENDER_COMMAND
22       If environmental variable GRASS_RENDER_COMMAND is defined, rendering is
23       redirected by display library to the given external command defined  by
24       this variable. Currently only Python scrips are supported.
25
26       Lets start with simple example of Python script called render.py:
27       #!/usr/bin/python2
28       import os
29       import sys
30       import grass.script as grass
31       from grass.script import task as gtask
32       os.environ[’GRASS_RENDER_IMMEDIATE’] = ’default’
33       os.environ[’GRASS_RENDER_FILE’] = ’output.png’
34       cmd, dcmd = gtask.cmdstring_to_tuple(sys.argv[1])
35       grass.run_command(’d.text’, text="Test of GRASS_RENDER_COMMAND redirection")
36       os.environ[’GRASS_RENDER_FILE_READ’] = ’TRUE’
37       grass.run_command(cmd, **dcmd)
38       After defining GRASS_RENDER_COMMAND variable (example for Bash):
39       export GRASS_RENDER_COMMAND=render.py
40       Display  GRASS  modules  like d.rast or d.vect will be executed by ren‐
41       der.py program.  For example the command
42       d.vect roadsmajor
43       produces output PNG file output.png which will  contain  rendered  fea‐
44       tures  from  vector  map roadsmajor and sample text "Test of GRASS_REN‐
45       DER_COMMAND redirection".
46

SEE ALSO

48        d.mon, variables
49

SOURCE CODE

51       Available at: Display drivers source code (history)
52
53       Main index | Display index | Topics index | Keywords index |  Graphical
54       index | Full index
55
56       © 2003-2019 GRASS Development Team, GRASS GIS 7.6.0 Reference Manual
57
58
59
60GRASS 7.6.0                                                  displaydrivers(1)
Impressum