g.gisenv(1)
π g.gisenv π
okay so like, welcome to the GRASS GIS User's Manual entry for g.gisenv, bestie β pull up a chair, we're gonna read this whole thing together and it's gonna be so good π«Ά
πΈ NAME πΈ
g.gisenv β outputs and modifies the user's current GRASS variable settings. β¨
If you give it no option at all, it just prints, like, every defined GRASS variable. no cap. π
π KEYWORDS π
general, settings, variables, scripts
β¨ SYNOPSIS β¨
g.gisenv
g.gisenv --help
g.gisenv [-sn] [get=variable[,variable,...]] [set="variable=value"]
[unset=variable[,variable,...]] [store=string] [separator=character]
[--help] [--verbose] [--quiet] [--ui]
π¦ Flags π¦
-sβ use shell syntax (for"eval"). it's giving let me source you energy.-nβ do NOT use shell syntax. the opposite vibe, iconic.--helpβ print usage summary π--verboseβ verbose module output (she's chatty, we love her)--quietβ quiet module output π€«--uiβ force launching GUI dialog π₯οΈβ¨
π Parameters π
get=variable[,variable,...]β GRASS variable to getset="variable=value"β GRASS variable to setunset=variable[,variable,...]β GRASS variable to unsetstore=stringβ where the GRASS variable is stored- Options:
gisrc,mapset - Default:
gisrc
- Options:
separator=characterβ separator for multiple GRASS variables- Special characters:
pipe,comma,space,tab,newline - Default:
newline
- Special characters:
π DESCRIPTION π
g.gisenv outputs and modifies the user's current GRASS GIS variable settings. when a user runs GRASS, certain variables get set specifying the GRASS data base, project, mapset, peripheral device drivers, etc., being used in the current GRASS session. these variable name settings are recognized for as long as the user is running a GRASS session. periodt. π
π₯ OPTIONS π₯
no prompts are given to the user when running g.gisenv. she just does the thing. no questions asked. π«‘
if you run it without arguments, g.gisenv lists all of the user's current GRASS variable settings. results are sent to standard output, and may look like this:
GISDBASE=/opt/grassdata/
LOCATION_NAME=nc_spm_08_grass7
MAPSET=/user1
GUI=gui
if the user specifies a get=variable_name on the command line
g.gisenv MAPSET
then only the value for that particular GRASS variable is output to standard output. possible variable names depend on the user's system, see variables list for details. and bestie, note that the variable names are case-insensitive. π
while other variables may be associated with each GRASS session (e.g., GRASS_GUI, GIS_LOCK, and other variables), the ones stated below are the essential ones. the main characters, if you will. π
GISDBASEβ theGISDBASEis a directory in which all users' GRASS data are stored. within theGISDBASE, data are segregated into subdirectories (called "projects") based on the map coordinate system used and the geographic extent of the data. each "project" directory itself contains subdirectories called "mapsets"; each "mapset" stores "data base elements" β the directories (e.g., thecell,cellhd,vector, etc., directories) in which GRASS data files are actually stored. πβ¨LOCATION_NAMEβ the user must choose to work with the data under a single GRASS project (previously called "location") within any given GRASS session; this project is then called the current GRASS project, and is specified by the variableLOCATION_NAME. theLOCATION_NAMEis the GRASS data base location whose data will be affected by any GRASS commands issued during the user's current GRASS session, and is a subdirectory of the currentGISDBASE. each "project" directory can contain multiple "mapset" directories (including the special mapsetPERMANENT). maps stored under the same GRASSLOCATION_NAME(and/or within the sameMAPSET) must use the same coordinate system and typically fall within the boundaries of the same geographic region. πΊοΈMAPSETβ each "mapset" contains a set of maps relevant to theLOCATION_NAMEdirectory in which it appears. eachLOCATION_NAMEcan contain multiple mapsets. (mapsets which fall under the sameLOCATION_NAMEall contain data geographically relevant to theLOCATION_NAME, and all store data in the same map coordinate system. frequently, maps are placed into different mapsets to distinguish file ownership β e.g., each user might have one or more own mapset(s), storing any maps that the user has created and/or are relevant to the own work.) during each GRASS session, the user must choose one mapset to be the current mapset; the current mapset setting is given byMAPSET, and is a subdirectory ofLOCATION_NAME. during a single GRASS session, the user can use available data in any of the mapsets stored under the currentLOCATION_NAMEdirectory that are in the user's mapset search path and accessible by the user. however, within a single GRASS session, the user only has write access to data stored under the current mapset (specified by the variableMAPSET). π
each "mapset" stores GRASS data base elements (i.e., the directories in which GRASS data files are stored). any maps created or modified by the user in the current GRASS session will be stored here. the MAPSET directory PERMANENT is generally reserved for the set of maps that form the base set for all users working under each LOCATION_NAME. πΎ
once within a GRASS session, GRASS users have access only to the data under a single GRASS data base directory (the current GRASS data base, specified by the variable GISDBASE), and to a single GRASS project directory (the current project, specified by the variable LOCATION_NAME). within a single session, the user may only modify the data in the current mapset (specified by the variable MAPSET), but may use data available under other mapsets under the same LOCATION_NAME. π
all of these names must be legal names on the user's current system. (so like, don't get cute with them, bestie. π)
the full path to the current mapset is determined from GISDBASE, LOCATION_NAME, MAPSET variables, in the example above:
/opt/grassdata/spearfish/PERMANENT
the full path can be printed using g.gisenv by providing multiple variables:
g.gisenv get=GISDBASE,LOCATION_NAME,MAPSET sep=β/β
/opt/grassdata/nc_spm_08_grass7/user1
π NOTES π
the output from g.gisenv when invoked without arguments is directly usable by Bash. the following command will cast each variable into the UNIX environment:
eval `g.gisenv`
this works only for Bash, sh, ksh, etc. the format of the output is not compatible with some other UNIX shells. β οΈ so like, vibe check your shell first, fr fr.
by default the GRASS variables are stored in gisrc file (defined by environmental variable GISRC). if store=mapset is given then the variables are stored in <gisdbase>/<project>/<mapset>/VAR after the current GRASS session is closed. ποΈβ¨
π EXAMPLES π
π§ Cache for raster operations
the maximum memory to be used, i.e. the cache size for raster rows, is set to 300 MB by default (GRASS variable MEMORYMB). to speed up raster operations, it is recommended to increase this setting if enough RAM is available. it is important to note that parallel processes will each consume this amount of RAM. π so be careful, she's hungry.
set the maximum memory to be used (in MB), i.e. the cache size for raster rows:
# set to 6 GB (default: 300 MB)
g.gisenv set="MEMORYMB=6000"
π§΅ Number of threads for parallel computing
set the number of threads for parallel computing:
# set to use 12 threads (default: 1)
g.gisenv set="NPROCS=12"
π GRASS Debugging
to print debugging messages, the variable DEBUG must be set to level equal or greater than 0:
g.gisenv set="DEBUG=3"
levels: (recommended levels) π
- 0 - silence
- 1 - message is printed once or few times per module
- 3 - each row (raster) or line (vector)
- 5 - each cell (raster) or point (vector)
to disable debugging messages:
g.gisenv unset="DEBUG"
the variable DEBUG controls debugging messages from GRASS libraries and modules. π
similarly WX_DEBUG controls debugging messages from wxGUI. π₯οΈ
π SEE ALSO π
g.access, g.filename, g.findfile, g.mapsets
see also list of selected GRASS gisenv variables π
π AUTHOR π
Michael Shapiro, U.S.Army Construction Engineering Research Laboratory
π SOURCE CODE π
available at: g.gisenv source code (history)
accessed: Saturday Jan 17 05:40:38 2026
Main index | General index | Topics index | Keywords index | Graphical index | Full index
Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual
okay that's the whole thing, you ate it, you read the whole page π«Ά this was GRASS 8.4.2's g.gisenv(1) and honestly? iconic. go set your variables, bestie, and remember: case-insensitive, no cap π
β¨π
π¦ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms