GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
displaydrivers(1) GRASS GIS User's Manual displaydrivers(1)

The current command line rendering mechanism is direct rendering into a file. The driver is selected by setting the GRASS_RENDER_IMMEDIATE variable or by running d.mon module.

List of available display drivers:

  • Cairo driver
  • PNG driver
  • PS driver (Postscript)
  • HTMLMAP driver

If environmental variable GRASS_RENDER_COMMAND is defined, rendering is redirected by display library to the given external command defined by this variable. Currently only Python scrips are supported.

Lets start with simple example of Python script called render.py:


#!/usr/bin/env python3
import os
import sys
import grass.script as grass
from grass.script import task as gtask
os.environ[’GRASS_RENDER_IMMEDIATE’] = ’default’
os.environ[’GRASS_RENDER_FILE’] = ’output.png’
cmd, dcmd = gtask.cmdstring_to_tuple(sys.argv[1])
grass.run_command(’d.text’, text="Test of GRASS_RENDER_COMMAND redirection")
os.environ[’GRASS_RENDER_FILE_READ’] = ’TRUE’
grass.run_command(cmd, **dcmd)

After defining GRASS_RENDER_COMMAND variable (example for Bash):

export GRASS_RENDER_COMMAND=render.py

Display GRASS modules like d.rast or d.vect will be executed by render.py program. For example the command

d.vect roadsmajor

produces output PNG file output.png which will contain rendered features from vector map roadsmajor and sample text "Test of GRASS_RENDER_COMMAND redirection".

d.mon, variables

Available at: Display drivers source code (history)

Main index | Display index | Topics index | Keywords index | Graphical index | Full index

© 2003-2021 GRASS Development Team, GRASS GIS 7.8.6 Reference Manual

GRASS 7.8.6

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.