1g.region(1)                   Grass User's Manual                  g.region(1)
2
3
4

NAME

6       g.region   -  Program  to  manage the boundary definitions for the geo‐
7       graphic region.
8

KEYWORDS

10       general
11

SYNOPSIS

13       g.region
14       g.region help
15       g.region   [-dplecmau3gb]     [region=name]      [rast=name[,name,...]]
16       [rast3d=name]    [vect=name]    [3dview=name]    [n=value]    [s=value]
17       [e=value]      [w=value]      [t=value]      [b=value]      [res=value]
18       [res3=value]       [nsres=value]       [ewres=value]      [tbres=value]
19       [zoom=name]   [align=name]   [save=name]   [--overwrite]
20
21   Flags:
22       -d  Set from default region
23
24       -p  Print the current region
25
26       -l  Print the current region in lat/long on current ellipsoid/datum
27
28       -e  Print the current region extent
29
30       -c  Print the current region map center coordinates
31
32       -m  Print region resolution in meters (geodesic)
33
34       -a  Align region to resolution (default = align to bounds,  works  only
35           for 2D resolution )
36
37       -u  Do not update the current region
38
39       -3  Print also 3D settings
40
41       -g  Print the current region (shell script style)
42
43       -b  Print the maximum bounding box in lat/long on WGS84 (-g mode only)
44
45       --overwrite
46
47   Parameters:
48       region=name
49           Set current region from named region
50
51       rast=name[,name,...]
52           Set region to match this raster map
53
54       rast3d=name
55           Set region to match this 3D raster map (both 2D and 3D values)
56
57       vect=name
58           Set region to match this vector map
59
60       3dview=name
61           Set region to match this 3dview file
62
63       n=value
64           Value for the northern edge (format dd:mm:ss{N|S})
65
66       s=value
67           Value for the southern edge (format dd:mm:ss{N|S})
68
69       e=value
70           Value for the eastern edge  (format ddd:mm:ss{E|W})
71
72       w=value
73           Value for the western edge  (format ddd:mm:ss{E|W})
74
75       t=value
76           Value for the top edge
77
78       b=value
79           Value for the bottom edge
80
81       res=value
82           Grid resolution 2D (both north-south and east-west)
83
84       res3=value
85           3D grid resolution (north-south, east-west and top-bottom)
86
87       nsres=value
88           North-south grid resolution 2D  (format dd:mm:ss)
89
90       ewres=value
91           East-west grid resolution 2D  (format dd:mm:ss)
92
93       tbres=value
94           Top-bottom grid resolution 3D
95
96       zoom=name
97           Raster map to zoom into
98
99       align=name
100           Raster map to align to
101
102       save=name
103           Save the current region to region definition file
104

DESCRIPTION

106       The g.region program allows the user to manage the settings of the cur‐
107       rent geographic region.  These regional boundaries can be  set  by  the
108       user  directly  and/or  set from a region definition file (stored under
109       the windows directory in the user's current mapset).  The user can cre‐
110       ate, modify, and store as many geographic region definitions as desired
111       for any given mapset.  However, only one  of  these  geographic  region
112       definitions  will  be  current  at  any  given  moment, for a specified
113       mapset;  i.e., GRASS programs that respect the geographic  region  set‐
114       tings will use the current geographic region settings.
115

DEFINITIONS

117       Region:
118              In GRASS, a region refers to a geographic area with some defined
119              boundaries, based on a specific map coordinate  system  and  map
120              projection.   Each  region  also has associated with it the spe‐
121              cific east-west and  north-south  resolutions  of  its  smallest
122              units (rectangular units called "cells").
123
124       The  region's  boundaries  are given as the northernmost, southernmost,
125       easternmost, and westernmost points that define its extent.  The  north
126       and  south boundaries are commonly called northings, while the east and
127       west boundaries are called eastings.
128
129       The region's cell resolution defines the size of the smallest piece  of
130       data  recognized (imported, analyzed, displayed, stored, etc.) by GRASS
131       programs affected by the current region settings.  The north-south  and
132       east-west  cell  resolutions  need  not be the same, thus allowing non-
133       square data cells to exist.
134
135       Default Region:
136              Each GRASS LOCATION_NAME has a fixed geographic  region,  called
137              the  default  geographic  region  (stored  in  the  region  file
138              DEFAULT_WIND under the special mapset PERMANENT),  that  defines
139              the  extent  of  the  data base.  While this provides a starting
140              point for defining new  geographic  regions,  user-defined  geo‐
141              graphic regions need not fall within this geographic region.
142
143       Current Region:
144              Each  mapset  has  a  current  geographic  region.   This region
145              defines the geographic area in  which  all  GRASS  displays  and
146              analyses will be done.  Data will be resampled, if necessary, to
147              meet the cell resolutions of the current geographic region  set‐
148              ting.
149
150       Region Data Base:
151              Each  GRASS  MAPSET  may  contain any number of pre-defined, and
152              named, geographic regions.  These region definitions are  stored
153              in  the  user's current mapset location under the windows direc‐
154              tory (also referred to as the user's data base of region defini‐
155              tions).   Any  of  these  pre-defined  geographic regions may be
156              selected, by name, to  become  the  current  geographic  region.
157              Users  may  also  access  saved  region definitions stored under
158              other mapsets in the current  location,  if  these  mapsets  are
159              included in the user's mapset search path.
160

REGION EDIT PROMPT

162       Most  of the options will require the user to edit a geographic region,
163       be it the current geographic region or one stored in  the  user's  data
164       base  of region definitions (the windows directory).  A standard prompt
165       is used to perform this edit.  An example is shown below:
166       ---------------------------------------------------------------
167       |                         IDENTIFY REGION                     |
168       |                                                             |
169       |           ===========  DEFAULT REGION  ==========           |
170       |           |    Default North: 3402025.00        |           |
171       |           |                                     |           |
172       |           |          ===YOUR REGION===          |           |
173       |           |          |  NORTH EDGE   |          |           |
174       |           |          |  3402025.00_  |          |           |
175       |           |          |               |          |           |
176       | Def West: |WEST EDGE |               |EAST EDGE | Def.East: |
177       | 233975.00 |233975.00_|               |236025.00_| 236025.00 |
178       |           |          |  SOUTH EDGE   |          |           |
179       |           |          |  3399975.00_  |          |           |
180       |           |          =================          |           |
181       |           |                                     |           |
182       |           |    Default South: 3399975.00        |           |
183       |           =======================================           |
184       |                                                             |
185       |              Default   GRID RESOLUTION   Region             |
186       |               50.00   --- East-West ---  50.00__            |
187       |               50.00   -- North-South --  50.00__            |
188       |                                                             |
189       |                                                             |
190       |     AFTER COMPLETING ALL ANSWERS, HIT <ESC> TO CONTINUE     |
191       ---------------------------------------------------------------
192        The fields NORTH EDGE, SOUTH EDGE, WEST EDGE and EAST  EDGE,  are  the
193       boundaries  of  the  geographic  region  that the user can change.  The
194       fields Default North, Default South, Def West  and  Def  East  are  the
195       boundaries of the default geographic region that are displayed for ref‐
196       erence and cannot be changed.  The two GRID  RESOLUTION  Region  fields
197       (east-west,  and  north-south) are the geographic region's cell resolu‐
198       tions that the user can change.  The two GRID RESOLUTION Default fields
199       list  the resolutions of the default geographic region;  these are dis‐
200       played for reference and cannot be changed here by the user.
201

REGION MANAGEMENT MENU OPTIONS

203       1      Modify the current geographic region directly Allows the user to
204              edit the current region.
205
206       2      Set  current  geographic  region  from default region Copies the
207              default region to the current geographic region, and  then  lets
208              the user edit the current geographic region.
209
210       3      Set current geographic region from a data base geographic region
211              Allows the user to select a geographic region by name  from  the
212              data base of geographic regions to become the current geographic
213              region, and then lets  the  user  edit  the  current  geographic
214              region.
215
216       Note:   geographic  region  definition files may be selected from other
217       mapsets as well, if accessible and in the user's mapset search path.
218
219       4      Set current geographic region from a  raster  (cell)  map  layer
220              Allows  the  user  to select a raster map layer, copies the cell
221              header for this map layer to the current geographic region,  and
222              then  lets  the  user  edit the current geographic region.  This
223              option is useful when subsequent GRASS operations will  be  used
224              to  produce  a  raster map layer from one input raster map layer
225              and it is necessary that the  result  coincide  with  the  input
226              raster map layer.
227
228       5      Save  the  current  geographic  region (window) in the data base
229              Allows the user to save the current geographic  region  settings
230              in  the  user's  data  base  of  such settings.  These files are
231              stored in the windows directory under the user's current mapset.
232              This  option is useful when the current geographic region is set
233              directly using option 2, or even by another GRASS program (e.g.,
234              d.m).   This  option  installs an otherwise temporary geographic
235              region setting into the geographic region definition  data  base
236              for recall when needed.
237
238       6      Create  a  new data base geographic region setting Creates a new
239              geographic region definition in the user's  data  base  of  such
240              settings  in  the  windows  directory  under the current mapset,
241              using the geographic region edit prompt described above.   After
242              the  geographic  region definition is created, the user is asked
243              if this geographic region setting should also  be  used  as  the
244              current geographic region.
245
246       7      Modify  a  data  base  geographic region setting Modifies a geo‐
247              graphic region setting (in the data base of such settings in the
248              windows  directory  of the current mapset), using the geographic
249              region edit prompt.  After the changes have been made, the  user
250              is  asked  if this geographic region setting should also be used
251              as the current geographic region.
252

NON-INTERACTIVE PROGRAM USE

254       Alternately, the user can modify the settings of the current geographic
255       region  by  specifying  all needed parameters on the command line.  The
256       user enters the command  g.region parms, where parms are the  following
257       parameters and/or flags:
258

EXAMPLES

260
261              g.region n=7360100 e=699000
262               will reset the northing and easting for the current region, but
263              leave the south edge, west edge, and the region cell resolutions
264              unchanged.
265
266
267       g.region n=51:36:05N e=10:10:05E s=51:29:55N w=9:59:55E res=0:00:01
268        will reset the northing, easting, southing, westing and resolution for
269       the current region, here in DMS latitude-longitude style (but also dec‐
270       imal degrees can be used).
271
272
273       g.region  -dp s=698000
274        will set the current region from the default region for the GRASS data
275       base location, reset the south edge  to  698000,  and  then  print  the
276       result.
277
278
279       g.region n=n+1000 w=w-500
280         The n=value may also be specified as a function of its current value:
281       n=n+value increases the current northing, while n=n-value decreases it.
282       This  is  also true for s=value, e=value, and w=value.  In this example
283       the current region's northern boundary is extended by  1000  units  and
284       the current region's western boundary is decreased by 500 units.
285
286
287       g.region n=s+1000 e=w+1000
288         This  form allows the user to set the region boundary values relative
289       to one another.  Here, the northern boundary coordinate is set equal to
290       1000  units  larger  than the southern boundary's coordinate value, and
291       the eastern boundary's coordinate value is  set  equal  to  1000  units
292       larger than the western boundary's coordinate value.  The corresponding
293       forms s=n-value and
294
295       w=e-value may be used to set the values of the  region's  southern  and
296       western  boundaries, relative to the northern and eastern boundary val‐
297       ues.
298       g.region rast=soils
299        This form will make the current region settings exactly  the  same  as
300       those given in the cell header file for the raster map layer soils.
301
302
303       g.region -up rast=soils
304         The -u option suppresses the re-setting of the current region defini‐
305       tion.  This can be useful when it is desired  to  only  extract  region
306       information.   In  this  case,  the  cell header file for the soils map
307       layer is printed without changing the current region settings.
308
309
310       g.region -p rast=soils
311        This will zoom into the smallest region which encompasses all non-zero
312       soils  data  values,  and  save the new region settings in a file to be
313       called soils and stored under the windows directory in the user's  cur‐
314       rent mapset.  The current region settings are not changed.
315
316
317       g.region b=0 t=3000 tbres=200 res3=100
318       g.region -p3
319         This will define the 3D region for voxel computations.  In this exam‐
320       ple a volume with bottom (0m) to top (3000m) at  horizontal  resolution
321       (100m) and vertical resolution (200m) is defined.
322
323
324       g.region -p
325        This will print the current region in the format:
326       projection: 1 (UTM)
327       zone:       13
328       datum:      nad27
329       ellipsoid:  clark66
330       north:      4928000
331       south:      4914000
332       west:       590000
333       east:       609000
334       nsres:      20
335       ewres:      20
336       rows:       700
337       cols:       950
338
339
340
341       g.region -p3
342        This will print the current region and the 3D region (used for voxels)
343       in the format:
344       projection: 1 (UTM)
345       zone:       13
346       datum:      nad27
347       ellipsoid:  clark66
348       north:      4928000
349       south:      4914000
350       west:       590000
351       east:       609000
352       top:        1.00000000
353       bottom:     0.00000000
354       nsres:      20
355       nsres3:     20
356       ewres:      20
357       ewres3:     20
358       tbres:      1
359       rows:       700
360       rows3:      700
361       cols:       950
362       cols3:      950
363       depths:     1
364
365
366
367       g.region -g
368        The -g  option  prints  the  region  in  the  following  script  style
369       (key=value) format:
370       n=4928000
371       s=4914000
372       w=590000
373       e=609000
374       nsres=20
375       ewres=20
376       rows=700
377       cols=950
378
379
380
381       g.region -bg
382         The  -bg  option  prints  the  region  in  the following script style
383       (key=value) format plus the boundary box in latitude-longitude/WGS84:
384       n=4928000
385       s=4914000
386       w=590000
387       e=609000
388       nsres=20
389       ewres=20
390       rows=700
391       cols=950
392       LL_W=-103.87080682
393       LL_E=-103.62942884
394       LL_N=44.50164277
395       LL_S=44.37302019
396
397
398
399       g.region -l
400        The -l option prints the region in the following format:
401       long: -103.86789484 lat: 44.50165890 (north/west corner)
402       long: -103.62895703 lat: 44.49904013 (north/east corner)
403       long: -103.63190061 lat: 44.37303558 (south/east corner)
404       long: -103.87032572 lat: 44.37564292 (south/west corner)
405       rows:       700
406       cols:       950
407       Center longitude: 103:44:59.170374W [-103.74977]
408       Center latitude:  44:26:14.439781N [44.43734]
409
410
411
412       g.region -pm
413        This will print the current region in the  format  (latitude-longitude
414       location):
415       projection: 3 (Latitude-Longitude)
416       zone:       0
417       ellipsoid:  wgs84
418       north:      90N
419       south:      40N
420       west:       20W
421       east:       20E
422       nsres:      928.73944902
423       ewres:      352.74269109
424       rows:       6000
425       cols:       4800
426         Note  that  the  resolution  is  here reported in meters, not decimal
427       degrees.
428
429       The -p (or -g) option is recognized last.  This means that all  changes
430       are applied to the region settings before printing occurs.
431

NOTE

433       After  all updates have been applied, the current region's southern and
434       western boundaries are (silently) adjusted so that the north/south dis‐
435       tance  is  a  multiple  of  the  north/south  resolution  and  that the
436       east/west distance is a multiple of the east/west resolution.
437
438       With the -a flag all four boundaries are adjusted to be even  multiples
439       of the resolution.
440
441       The -m flag will report the region resolution in meters. The resolution
442       is calculated by averaging the resolution  at  the  region  boundaries.
443       This  resolution  is  calculated  by  dividing the geodesic distance in
444       meters at the boundary by the number of rows or columns.   For  example
445       the east / west resolution (ewres) is determined from an average of the
446       geodesic distances at the North and South  boundaries  divided  by  the
447       number of columns.
448

SEE ALSO

450       d.zoom
451       g.access
452       g.mapsets
453       g.projinfo
454

AUTHOR

456       Michael Shapiro, U.S.Army Construction Engineering Research Laboratory
457
458       Last changed: $Date: 2005/12/22 14:37:05 $
459
460       Full index
461
462
463
464GRASS 6.2.2                                                        g.region(1)
Impressum