1variables(1) Grass User's Manual variables(1)
2
3
4
6 There are two types of variables:
7
8 · shell environment variables,
9
10 · GRASS gisenv variables.
11 There are a number of shell environment variable groups:
12
13 · variables for rendering
14
15 · variables for internal use
16 Note: Any setting which needs to be modifiable by a GRASS module (e.g.
17 MONITOR by d.mon) has to be a GRASS gisenv variable.
18
20 Setting shell environment variables depends on the shell being used:
21 Bash:
22 export VARIABLE=value
23 Csh:
24 setenv VARIABLE value
25 Cmd.exe (Windows):
26 set VARIABLE=value
27 To set up shell environment variables permanently:
28
29 · To get personal BASH shell definitions (aliases, color listing
30 option, ...) into GRASS, store them in:
31 $HOME/.grass7/bashrc
32
33 · To get personal CSH shell definitions (aliases, color listing
34 option, ...) into GRASS, store them in:
35 $HOME/.grass7/cshrc
36
38 Use g.gisenv within GRASS. This permanently predefines GRASS variables
39 in the .grass7/rc file.
40 Usage:
41 g.gisenv set="VARIABLE=VALUE"
42 It looks unusual with two equals signs, but g.gisenv serves dual duty
43 for getting and setting GRASS variables.
44
45 If the user just specifies a variable name, it defaults to get mode.
46 For example:
47 g.gisenv MAPSET
48 PERMANENT
49
51 [ To be set from the terminal shell or startup scripts ]
52
53 GISBASE
54 directory where GRASS lives. This is set automatically by the
55 startup script.
56
57 GISRC
58 name of .grass7/rc file. Defines the system wide value while in a
59 GRASS session.
60
61 GRASS_ADDON_PATH
62 [grass startup script, g.extension]
63 specifies additional path(s) containing local and/or custom GRASS
64 modules extra to the standard distribution.
65
66 GRASS_ADDON_BASE
67 [grass startup script]
68 allows specifying additional GISBASE for local GRASS modules (nor‐
69 mally installed as GRASS Addons by g.extension module) extra to
70 standard distribution. The default on GNU/Linux is
71 $HOME/.grass7/addons, on MS Windows $APPDATA\GRASS7\addons.
72
73 GRASS_ADDON_ETC
74 [libgis, g.findetc]
75 specify paths where support files (etc/) may be found external to
76 standard distribution.
77
78 GRASS_BATCH_JOB
79 defines the name (path) of a shell script to be processed as batch
80 job.
81
82 GRASS_COMPRESSOR
83 [libraster]
84 the compression method for new raster maps can be set with the
85 environment variable GRASS_COMPRESSOR. Supported methods are RLE,
86 ZLIB, LZ4, and BZIP2 if GRASS has been compiled with BZIP2 support.
87 The default is ZLIB which can be changed with e.g. GRASS_COMPRES‐
88 SOR=LZ4
89
90 GRASS_DB_ENCODING
91 [various modules, wxGUI]
92 encoding for vector attribute data (utf-8, ascii, iso8859-1,
93 koi8-r)
94
95 GIS_ERROR_LOG
96 If set, GIS_ERROR_LOG should be the absolute path to the log file
97 (a relative path will be interpreted relative to the process’ cwd,
98 not the cwd at the point the user set the variable). If not set,
99 $HOME/GIS_ERROR_LOG is used instead. The file will only be used if
100 it already exists.
101
102 GRASS_ERROR_MAIL
103 set to any value to send user mail on an error or warning that hap‐
104 pens while stderr is being redirected.
105
106 GRASS_FONT
107 [display drivers]
108 specifies the font as either the name of a font from $GIS‐
109 BASE/etc/fontcap (or alternative fontcap file specified by
110 GRASS_FONT_CAP), or alternatively the full path to a FreeType font
111 file.
112
113 GRASS_ENCODING
114 [display drivers]
115 the encoding to be assumed for text which is drawn using a freetype
116 font; may be any encoding know to iconv.
117
118 GRASS_FONT_CAP
119 [g.mkfontcap, d.font, display drivers]
120 specifies an alternative location (to $GISBASE/etc/fontcap) for the
121 font configuration file.
122
123 GRASS_FULL_OPTION_NAMES
124 [parser]
125 Generates a warning if GRASS_FULL_OPTION_NAMES is set (to anything)
126 and a found string is not an exact match for the given string.
127
128 GRASS_GUI
129 either text (text user interface), gtext (text user interface with
130 GUI welcome screen), or gui (graphical user interface) to define
131 non-/graphical startup. Can also specify the name of the GUI to
132 use, e.g. wxpython (wxGUI). Also exists as a GRASS gisenv variable
133 (see below). If this shell variable exists at GRASS startup, it
134 will determine the GUI used. If it is not defined startup will
135 default to the last GUI used.
136
137 GRASS_HTML_BROWSER
138 [init.sh, wxgui]
139 defines name of HTML browser. For most platforms this should be an
140 executable in your PATH, or the full path to an executable.
141 Mac OS X runs applications differently from the CLI. Therefore,
142 GRASS_HTML_BROWSER should be the application’s signature, which is
143 a domain-like name, just reversed, i.e. com.apple.Safari. To find
144 an application’s signature, type the following in a Terminal (fill
145 in the path to the application you are interested in, for example:
146 /Applications/Safari.app):
147 grep -A 1 "CFBundleIdentifier" /path/to/application.app/Con‐
148 tents/Info.plist
149 The signature is the <string> following the <key>, without the
150 bracketing <string> tags.
151
152 GRASS_INT_ZLIB
153 [libraster]
154 if the environment variable GRASS_INT_ZLIB exists and has the value
155 0, new compressed integer (CELL type) raster maps will be com‐
156 pressed using RLE compression.
157 If the variable doesn’t exist, or the value is non-zero, zlib com‐
158 pression will be used instead. Such rasters will have a compressed
159 value of 2 in the cellhd file.
160 Obviously, decompression is controlled by the raster’s compressed
161 value, not the environment variable.
162
163 GRASS_ZLIB_LEVEL
164 [libgis]
165 if the environment variable GRASS_ZLIB_LEVEL exists and its value
166 can be parsed as an integer, it determines the compression level
167 used when new compressed raster maps are compressed using zlib com‐
168 pression. This applies to all raster map types (CELL, FCELL,
169 DCELL).
170 Valid zlib compression levels are -1 to 9. The GRASS_ZLIB_LEVEL=-1
171 corresponds to the zlib default value (equivalent to
172 GRASS_ZLIB_LEVEL=6). Often GRASS_ZLIB_LEVEL=1 gives the best com‐
173 promise between speed and compression.
174 If the variable doesn’t exist, or the value cannot be parsed as an
175 integer, zlib’s default compression level 6 will be used.
176
177 GRASS_MESSAGE_FORMAT
178 [various modules, wxGUI]
179 it may be set to either
180
181 · standard - sets percentage output and message formatting style
182 to standard formatting,
183
184 · gui - sets percentage output and message formatting style to
185 GUI formatting,
186
187 · silent - disables percentage output and error messages,
188
189 · plain - sets percentage output and message formatting style to
190 ASCII output without rewinding control characters.
191
192 GRASS_MOUSE_BUTTON
193 [various modules]
194 swaps mouse buttons for two-button or left-handed mice. Its value
195 has three digits 1, 2, and 3, which represent default left, middle,
196 and right buttons respectively. Setting to 132 will swap middle and
197 right buttons. Note that this variable should be set before a dis‐
198 play driver is initialized (e.g., d.mon x0).
199
200 GRASS_PAGER
201 [various modules]
202 it may be set to either less, more, or cat.
203
204 GRASS_PERL
205 [used during install process for generating man pages]
206 set Perl with path.
207
208 GRASS_SKIP_MAPSET_OWNER_CHECK
209 By default it is not possible to work with MAPSETs that are not
210 owned by current user. Setting this variable to any non-empty value
211 allows the check to be skipped.
212
213 GRASS_SH
214 [shell scripts on Windows]
215 path to bourne shell interpreter used to run shell scripts.
216
217 GRASS_SIGSEGV_ON_ERROR
218 Raise SIGSEGV if an error occurs]
219 This variable can be set for debugging purpose. The call of
220 G_fatal_error() will end in a segmentation violation. GDB can be
221 used to trace the source of the error.
222
223 GRASS_PYTHON
224 [wxGUI, Python Ctypes]
225 set to override Python executable.
226 On Mac OS X this should be the pythonw executable for the wxGUI to
227 work.
228
229 GRASS_VECTOR_LOWMEM
230 [vectorlib]
231 If the environment variable GRASS_VECTOR_LOWMEM exists, memory con‐
232 sumption will be reduced when building vector topology support
233 structures. Recommended for creating large vectors.
234
235 GRASS_VECTOR_OGR
236 [vectorlib, v.external.out]
237 If the environment variable GRASS_VECTOR_OGR exists and vector out‐
238 put format defined by v.external.out is PostgreSQL, vector data is
239 written by OGR data provider even the native PostGIS data provider
240 is available.
241
242 GRASS_VECTOR_EXTERNAL_IMMEDIATE
243 [vectorlib, v.external.out]
244 If the environment variable GRASS_VECTOR_EXTERNAL_IMMEDIATE exists
245 and vector output format defined by v.external.out is non-native,
246 vector features are written to output external datasource immedi‐
247 ately. By default, the vector library writes output data to a tem‐
248 porary vector map in native format and when closing the map, the
249 features are transferred to output external datasource. Note: if
250 output vector format is topological PostGIS format, then the vector
251 library writes features immediately to output database (in this
252 case GRASS_VECTOR_EXTERNAL_IMMEDIATE is ignored).
253
254 GRASS_VECTOR_EXTERNAL_IGNORE
255 [vectorlib]
256 If the environment variable GRASS_VECTOR_EXTERNAL_IGNORE exists,
257 output vector format defined by v.external.out is ignored. The for‐
258 mat is always native.
259
260 GRASS_VECTOR_TEMPORARY
261 [vectorlib]
262 If the environment variable GRASS_VECTOR_TEMPORARY exists, GRASS
263 vector library will operate on temporary vector maps. New vector
264 maps will be created in temporary directory (see GRASS_VEC‐
265 TOR_TMPDIR_MAPSET variable), existing vector maps will be read (if
266 found) also from this directory. It may be set to either:
267
268 · keep - the temporary vector map is not deleted when closing the
269 map.
270
271 · move - the temporary vector map is moved to the current mapset
272 when closing the map.
273
274 · delete - the temporary vector map is deleted when closing the
275 map.
276 Default value is keep. Note that temporary vector maps are not visible
277 to the user via g.list or wxGUI. They are used internally by the GRASS
278 modules and deleted automatically when GRASS session is quited.
279
280 GRASS_VECTOR_TMPDIR_MAPSET
281 [vectorlib]
282 By default GRASS temporary directory is located in $LOCA‐
283 TION/$MAPSET/.tmp/$HOSTNAME. If GRASS_VECTOR_TMPDIR_MAPSET is set
284 to ’0’, the temporary directory is located in TMPDIR (environmental
285 variable defined by the user or GRASS initialization script if not
286 given).
287 Important note: This variable is currently used only in vector
288 library. In other words the variable is ignored by raster or
289 raster3d library.
290
291 GRASS_VECTOR_TOPO_DEBUG
292 [vectorlib, v.generalize]
293 If the environment variable GRASS_VECTOR_TOPO_DEBUG exists, v.gen‐
294 eralize runs in extremely slow debug mode.
295
296 GRASS_WXBUNDLED
297 [wxGUI]
298 set to tell wxGUI that a bundled wxPython will be used.
299 When set, the wxGUI will not check the wxPython version, as this
300 function is incompatible with a bundled wxPython. It is up to the
301 packager to make sure that a compatible wxPython version is bun‐
302 dled.
303
304 GRASS_WXVERSION
305 [wxGUI]
306 set to tell wxGUI which version of wxPython to use.
307 When set, the wxGUI will select the given wxPython version. It’s
308 useful when multiple versions of wxPython are installed and the
309 user wants to run wxGUI with non-default wxPython version.
310
311 GRASS_XTERM
312 [lib/init/grass-xterm-wrapper, lib/init/grass-xterm-mac]
313 set to any value (e.g. rxvt, aterm, gnome-terminal, konsole) to
314 substitute ’x-terminal-emulator’ or ’xterm’. The Mac OS X app
315 startup defaults to an internal ’$GISBASE/etc/grass-xterm-mac’,
316 which emulates the necessary xterm functionality in Terminal.app.
317
318 GRASS_UI_TERM
319 set to any value to use the terminal based parser.
320
321 GRASS_VERSION
322 reports the current version number (used by R-stats interface etc);
323 should not be changed by user.
324
325 GRASS_NO_GLX_PBUFFERS
326 [nviz]
327 set to any value to disable the use of GLX Pbuffers.
328
329 GRASS_NO_GLX_PIXMAPS
330 [nviz]
331 Set to any value to disable the use of GLX Pixmaps.
332
333 OMP_NUM_THREADS
334 [OpenMP]
335 If OpenMP support is enabled this limits the number of threads.
336 The default is set to the number of CPUs on the system. Setting to
337 ’1’ effectively disables parallel processing.
338
339 TMPDIR, TEMP, TMP
340 [Various GRASS GIS commands and wxGUI]
341 The default wxGUI temporary directory is chosen from a plat‐
342 form-dependent list, but the user can control the selection of this
343 directory by setting one of the TMPDIR, TEMP or TMP environment
344 variables Hence the wxGUI uses $TMPDIR if it is set, then $TEMP,
345 otherwise /tmp.
346
347 List of selected GRASS environment variables for rendering
348 [ In addition to those which are understood by specific GRASS display
349 drivers, the following variables affect rendering. ]
350
351 GRASS_RENDER_IMMEDIATE
352 tells the display library which driver to use; possible values:
353 cairo, png, ps, html or default
354 Default display driver is cairo (if available) otherwise png.
355
356 GRASS_RENDER_WIDTH
357 defines the width of output image (default is 640).
358
359 GRASS_RENDER_HEIGHT
360 defines the height of output image (default is 480).
361
362 GRASS_RENDER_FILE
363 the name of the resulting image file.
364
365 GRASS_RENDER_FRAME
366 contains 4 coordinates, top,bottom,left,right (pixel values) with
367 respect to the top left corner of the output image, defining the
368 initial frame.
369
370 GRASS_RENDER_LINE_WIDTH
371 defines default line width.
372
373 GRASS_RENDER_TEXT_SIZE
374 defines default text size.
375
376 GRASS_RENDER_COMMAND
377 external command called by display library to render data (see
378 example in display drivers page for details).
379 Currently only Python scripts are supported. For specific
380 driver-related variables see:
381
382 · Cairo display driver
383
384 · PNG display driver
385
386 · PS (Postscript) display driver
387
388 · HTML display driver
389
390 List of selected internal GRASS environment variables
391 [ These variables are intended for internal use only by the GRASS soft‐
392 ware to facilitate communication between the GIS engine, GRASS scripts,
393 and the GUI. The user should not set these in a GRASS session. They
394 are meant to be set locally for specific commands. ]
395
396 GRASS_OVERWRITE
397 [all modules]
398 toggles map overwrite.
399
400 · 0 - maps are protected (default),
401
402 · 1 - maps with identical names will be overwritten.
403 This variable is automatically created by g.parser so that the --over‐
404 write option will be inherited by dependent modules as the script runs.
405 Setting either the GRASS_OVERWRITE environment variable or the OVER‐
406 WRITE gisenv variable detailed below will cause maps with identical
407 names to be overwritten.
408
409 GRASS_VERBOSE
410 [all modules]
411 toggles verbosity level
412
413 · -1 - complete silence (also errors and warnings are discarded)
414
415 · 0 - only errors and warnings are printed
416
417 · 1 - progress and important messages are printed (percent com‐
418 plete)
419
420 · 2 - all module messages are printed
421
422 · 3 - additional verbose messages are printed
423 This variable is automatically created by g.parser so that the --ver‐
424 bose or --quiet flags will be inherited by dependent modules as the
425 script runs.
426
427 GRASS_REGION
428 [libgis]
429 override region settings, separate parameters with a ";". Format is
430 the same as in the WIND region settings file. Otherwise use is the
431 same as WIND_OVERRIDE.
432
433 WIND_OVERRIDE
434 [libgis]
435 it causes programs to use the specified named region (created with
436 e.g. g.region save=...) to be used as the current region, instead
437 of the region from the WIND file.
438 This allows programs such as the GUI to run external commands on an
439 alternate region without having to modify the WIND file then change
440 it back afterwards.
441
443 [ Use g.gisenv to get/set/unset/change them ]
444
445 DEBUG
446 [entire GRASS]
447 sets level of debug message output (0: no debug messages)
448 g.gisenv set=DEBUG=0
449
450 WX_DEBUG
451 [wxGUI]
452 sets level of debug message output for wxGUI (0: no debug messages,
453 1-5 debug levels)
454
455 GISDBASE
456 initial database
457
458 GIS_LOCK
459 lock ID to prevent parallel GRASS use,
460 process id of the start-up shell script
461
462 GUI
463 See GRASS_GUI environmental variable for details.
464
465 LOCATION
466 full path to location directory
467
468 LOCATION_NAME
469 initial location name
470
471 MAPSET
472 initial mapset
473
474 OVERWRITE
475 [all modules]
476 toggles map overwrite.
477
478 · 0 - maps are protected (default),
479
480 · 1 - maps with identical names will be overwritten.
481 This variable is automatically created by g.parser so that the --over‐
482 write option will be inherited by dependent modules as the script runs.
483 Setting either the GRASS_OVERWRITE environment variable or the OVER‐
484 WRITE gisenv variable detailed below will cause maps with identical
485 names to be overwritten.
486
488 $HOME/.grass7/rc
489 stores the GRASS gisenv variables (not shell environment variables)
490
491 $HOME/.grass7/bashrc
492 stores the shell environment variables (Bash only)
493
494 $HOME/.grass7/env.bat
495 stores the shell environment variables (MS Windows only)
496
497 $HOME/.grass7/login
498 stores the DBMI passwords in this hidden file. Only the file owner
499 can access this file.
500
501 $HOME/GIS_ERROR_LOG
502 if this file exists then all GRASS error and warning messages are
503 logged here. Applies to current user. To generate the file, use:
504 touch $HOME/GIS_ERROR_LOG
505 See also GIS_ERROR_LOG variable. Note: On MS Windows the files are
506 stored in %APPDATA%.
507
509 g.gisenv, g.parser
510
511 Last changed: $Date: 2016-09-19 11:37:30 +0200 (Mon, 19 Sep 2016) $
512
513 Main index | Topics index | Keywords index | Graphical index | Full
514 index
515
516 © 2003-2019 GRASS Development Team, GRASS GIS 7.4.4 Reference Manual
517
518
519
520GRASS 7.4.4 variables(1)