1g.gisenv(1) Grass User's Manual g.gisenv(1)
2
3
4
6 g.gisenv - Outputs and modifies the user's current GRASS variable set‐
7 tings.
8
10 general
11
13 g.gisenv
14 g.gisenv help
15 g.gisenv [get=VARIABLE] [set="VARIABLE=value"] [store=string]
16
17 Parameters:
18 get=VARIABLE
19 GRASS variable to get
20
21 set=
22 GRASS variable to set
23
24 store=string
25 Where GRASS variable is stored Options: gisrc,mapset Default: gisrc
26
28 When a user runs GRASS, certain variables are set specifying the GRASS
29 data base, location, mapset, peripheral device drivers, etc., being
30 used in the current GRASS session. These variable name settings are
31 recognized as long as the user is running a GRASS session.
32
34 No prompts are given to the user when running g.gisenv. If run without
35 arguments, g.gisenv lists all of the user's current GRASS variable set‐
36 tings. Results are sent to standard output, and may look like this:
37 GISDBASE=/usr/grass5/data
38 LOCATION_NAME=spearfish
39 MAPSET=PERMANENT
40 In this example, the full path name of the user's current location
41 (i.e., $LOCATION_NAME) is /usr/grass5/data/spearfish, and the full path
42 name of the user's current mapset (i.e., $MAPSET) is
43 /usr/grass5/data/spearfish/PERMANENT.
44
45 If the user specifies a variable_name on the command line (e.g.,
46 g.gisenv MAPSET), only the value for that particular GRASS variable is
47 output to standard output. Possible variable names depend on the
48 user's system, see variables list for details.
49
50 While other variables may be associated with each GRASS session (e.g.,
51 DIGITIZER, PAINTER, DISPLAY, and other variables), those stated below
52 are essential.
53
54 GISDBASE
55 The $GISDBASE is a directory in which all users' GRASS data are
56 stored. Within the $GISDBASE, data are segregated into subdi‐
57 rectories (called "locations") based on the map coordinate sys‐
58 tem used and the geographic extent of the data. Each "location"
59 directory itself contains subdirectories called "mapsets"; each
60 "mapset" stores "data base elements" -- the directories (e.g.,
61 the cell, cellhd, dig, etc., directories) in which GRASS data
62 files are actually stored.
63
64 LOCATION_NAME
65 The user must choose to work with the data under a single GRASS
66 location within any given GRASS session; this location is then
67 called the current GRASS location, and is specified by the vari‐
68 able $LOCATION_NAME. The $LOCATION_NAME is the GRASS data base
69 location whose data will be affected by any GRASS commands
70 issued during the user's current GRASS session, and is a subdi‐
71 rectory of the current $GISDBASE. Each "location" directory can
72 contain multiple "mapset" directories (including the special
73 mapset PERMANENT). Maps stored under the same GRASS LOCA‐
74 TION_NAME (and/or within the same MAPSET) must use the same
75 coordinate system and typically fall within the boundaries of
76 the same geographic region (aka, "location").
77
78 MAPSET Each "mapset" contains a set of maps relevant to the LOCA‐
79 TION_NAME directory in which it appears. Each LOCATION_NAME can
80 contain multiple mapsets. (Mapsets which fall under the same
81 LOCATION_NAME all contain data geographically relevant to the
82 LOCATION_NAME, and all store data in the same map coordinate
83 system. Frequently, maps are placed into different mapsets to
84 distinguish file ownership -- e.g., each user might have his own
85 mapset, storing any maps that he has created and/or are relevant
86 to his work.) During each GRASS session, the user must choose
87 one mapset to be the current mapset; the current mapset setting
88 is given by $MAPSET, and is a subdirectory of $LOCATION_NAME.
89 During a single GRASS session, the user can use available data
90 in any of the mapsets stored under the current LOCATION_NAME
91 directory that are in the user's mapset search path and accessi‐
92 ble by the user. However, within a single GRASS session, the
93 user only has write access to data stored under the current
94 mapset (specified by the variable $MAPSET).
95
96 Each "mapset" stores GRASS data base elements (i.e., the directories in
97 which GRASS data files are stored). Any maps created or modified by
98 the user in the current GRASS session will be stored here. The MAPSET
99 directory PERMANENT is generally reserved for the set of maps that form
100 the base set for all users working under each LOCATION_NAME.
101
102 Once within a GRASS session, GRASS users have access only to the data
103 under a single GRASS data base directory (the current GRASS data base,
104 specified by the variable $GISDBASE), and to a single GRASS location
105 directory (the current location, specified by the variable $LOCA‐
106 TION_NAME). Within a single session, the user may only modify the data
107 in the current mapset (specified by the variable $MAPSET), but may use
108 data available under other mapsets under the same LOCATION_NAME.
109
110 All of these names must be legal names on the user's current system.
111 For UNIX users, names less than 14 characters and containing no non-
112 printing or space codes are permissible. Examples of permissible names
113 include: one, mymap, VeGe_map, and 1_for_me. The underscore character
114 can safely be used in place of a blank for multiple-word names.
115
117 The output from g.gisenv when invoked without arguments is directly
118 usable by /bin/sh. The following command will cast each variable into
119 the UNIX environment:
120
121
122 eval `g.gisenv`
123
124
125 This works only for /bin/sh. The format of the output is not compatible
126 with other UNIX shells.
127
128 GRASS Debugging:
129 To print debugging messages, the variable DEBUG must be set to level
130 equal or greater than 0:
131
132
133 <TT>g.gisenv set="DEBUG=3"
134
135
136 Levels: (recommended levels)
137
138 0 - silence
139
140 1 - message is printed once or few times per module
141
142 3 - each row (raster) or line (vector)
143
144 5 - each cell (raster) or point (vector)
145 To disable debugging messages, DEBUG must be set back to 0:
146
147
148 <TT>g.gisenv set="DEBUG=0"
149
150
152 g.access
153 g.ask
154 g.filename
155 g.findfile
156 g.mapsets
157 variables list
158
160 Michael Shapiro, U.S.Army Construction Engineering Research Laboratory
161
162 Last changed: $Date: 2005/12/07 13:31:15 $
163
164 Full index
165
166
167
168GRASS 6.2.2 g.gisenv(1)