windows
directory in the user's current
mapset). The user can create, modify, and store as many
geographic region definitions as desired for any given
mapset. However, only one of these geographic region
definitions will be current at any given moment, for a
specified mapset; i.e., GRASS programs that respect the
geographic region settings will use the current geographic
region settings.
The region's boundaries are given as the northernmost, southernmost, easternmost, and westernmost points that define its extent (cell edges). The north and south boundaries are commonly called northings, while the east and west boundaries are called eastings.
The region's cell resolution defines the size of the smallest piece of data recognized (imported, analyzed, displayed, stored, etc.) by GRASS modules affected by the current region settings. The north-south and east-west cell resolutions need not be the same, thus allowing non-square data cells to exist.
Typically all raster and display modules are affected by the current region settings, but not vector modules. Some special modules diverge from this rule, for example raster import modules and v.in.region.
DEFAULT_WIND
under
the special mapset PERMANENT
), that defines the
extent of the data base. While this provides a starting
point for defining new geographic regions, user-defined
geographic regions need not fall within this geographic
region. The current region can be reset to the default region
with the -d flag. The default region is initially set
when the project is first created and can be reset using the
-s flag.
windows
directory (also
referred to as the user's saved region definitions).
Any of these pre-defined geographic regions
may be selected, by name, to become the current geographic
region. Users may also access saved region definitions
stored under other mapsets in the current project, if
these mapsets are included in the user's mapset search
path or the '@' operator is used (region_name@mapset
).
With the -a flag all four boundaries are adjusted to be even multiples of the resolution, aligning the region to the resolution supplied by the user. The default is to align the region resolution to match the region boundaries.
The -m flag will report the region resolution in meters. The resolution is calculated by averaging the resolution at the region boundaries. This resolution is calculated by dividing the geodesic distance in meters at the boundary by the number of rows or columns. For example the east / west resolution (ewres) is determined from an average of the geodesic distances at the North and South boundaries divided by the number of columns.
The -p (or -g) option is recognized last. This means that all changes are applied to the region settings before printing occurs.
The -g flag prints the current region settings in shell script style.
This format can be given back to g.region on its command line.
This may also be used to save region settings as shell environment variables
with the UNIX eval command, "eval `g.region -g`
".
With -u flag current region is not updated even if one or more options for changing region is used (res=, raster=, etc). This can be used for example to print modified region values for further use without actually modifying the current region. Similarly, -o flag forces to update current region file even when e.g., only printing was specified. Flag -o was added in GRASS GIS version 8 to simulate g.region behavior in prior versions when current region file was always updated unless -u was specified.
If the user also includes the raster=name option on the command line, zoom=name will set the current region settings to the smallest region encompassing all non-NULL data in the named zoom map that fall inside the region stated in the cell header for the named raster map.
g.region -p
projection: 1 (UTM) zone: 13 datum: nad27 ellipsoid: clark66 north: 4928000 south: 4914000 west: 590000 east: 609000 nsres: 20 ewres: 20 rows: 700 cols: 950
g.region -p3
projection: 1 (UTM) zone: 13 datum: nad27 ellipsoid: clark66 north: 4928000 south: 4914000 west: 590000 east: 609000 top: 1.00000000 bottom: 0.00000000 nsres: 20 nsres3: 20 ewres: 20 ewres3: 20 tbres: 1 rows: 700 rows3: 700 cols: 950 cols3: 950 depths: 1
g.region -g
n=4928000 s=4914000 w=590000 e=609000 nsres=20 ewres=20 rows=700 cols=950
g.region -bg
n=4928000 s=4914000 w=590000 e=609000 nsres=20 ewres=20 rows=700 cols=950 LL_W=-103.87080682 LL_E=-103.62942884 LL_N=44.50164277 LL_S=44.37302019
g.region -l
long: -103.86789484 lat: 44.50165890 (north/west corner) long: -103.62895703 lat: 44.49904013 (north/east corner) long: -103.63190061 lat: 44.37303558 (south/east corner) long: -103.87032572 lat: 44.37564292 (south/west corner) rows: 700 cols: 950 Center longitude: 103:44:59.170374W [-103.74977] Center latitude: 44:26:14.439781N [44.43734]
g.region -pm
projection: 3 (Latitude-Longitude) zone: 0 ellipsoid: wgs84 north: 90N south: 40N west: 20W east: 20E nsres: 928.73944902 ewres: 352.74269109 rows: 6000 cols: 4800
g.region n=7360100 e=699000
g.region n=51:36:05N e=10:10:05E s=51:29:55N w=9:59:55E res=0:00:01
g.region -dp s=698000
g.region n=n+1000 w=w-500
g.region n=s+1000 e=w+1000
w=e-value may be used to set the values of the region's southern and western boundaries, relative to the northern and eastern boundary values.
g.region raster=soils
g.region raster=soils zoom=soils
g.region -up raster=soils
g.region -up zoom=soils save=soils
windows
directory in the
user's current mapset. The current region settings are not
changed.
g.region b=0 t=3000 tbres=200 res3=100
g.region -p3
soils.shp
into new external vector map soils_cut.shp
using the OGR ogr2ogr tool:eval `g.region -g` ogr2ogr -spat $w $s $e $n soils_cut.shp soils.shp
p016r035_7t20020524_z17_nn30.tif
into new external raster
map p016r035_7t20020524_nc_spm_wake_nn30.tif
using the GDAL
gdalwarp tool:eval `g.region -g` gdalwarp -t_srs "`g.proj -wf`" -te $w $s $e $n \ p016r035_7t20020524_z17_nn30.tif \ p016r035_7t20020524_nc_spm_wake_nn30.tif