r.region
Sets the boundary definitions for a raster map.
r.region [-cda] map=name [region=name] [raster=name] [vector=name] [n=value] [s=value] [e=value] [w=value] [align=name] [--verbose] [--quiet] [--qq] [--ui]
Example:
r.region map=name
grass.script.run_command("r.region", map, region=None, raster=None, vector=None, n=None, s=None, e=None, w=None, align=None, flags=None, verbose=False, quiet=False, superquiet=False)
Example:
gs.run_command("r.region", map="name")
Parameters
map=name [required]
Name of raster map to change
region=name
Set region from named region
raster=name
Set region to match this raster map
vector=name
Name of vector map
Set region to match this vector map
n=value
Value for the northern edge
s=value
Value for the southern edge
e=value
Value for the eastern edge
w=value
Value for the western edge
align=name
Raster map to align to
-c
Set from current region
-d
Set from default region
-a
Auto-adjustment for lat/lon
Attempt to fix small precision errors in resolution and extents
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--qq
Very quiet module output
--ui
Force launching GUI dialog
map : str, required
Name of raster map to change
Used as: input, raster, name
region : str, optional
Set region from named region
Used as: input, region, name
raster : str, optional
Set region to match this raster map
Used as: input, raster, name
vector : str, optional
Name of vector map
Set region to match this vector map
Used as: input, vector, name
n : str, optional
Value for the northern edge
Used as: value
s : str, optional
Value for the southern edge
Used as: value
e : str, optional
Value for the eastern edge
Used as: value
w : str, optional
Value for the western edge
Used as: value
align : str, optional
Raster map to align to
Used as: input, raster, name
flags : str, optional
Allowed values: c, d, a
c
Set from current region
d
Set from default region
a
Auto-adjustment for lat/lon
Attempt to fix small precision errors in resolution and extents
verbose: bool, optional
Verbose module output
Default: False
quiet: bool, optional
Quiet module output
Default: False
superquiet: bool, optional
Very quiet module output
Default: False
DESCRIPTION
The r.region program allows the user to manage the boundaries of a
raster map. These boundaries can be set by the user directly and/or set
from a region definition file (stored under the windows
directory in
the user's current mapset), a raster or vector map, or a 3dview file.
The align parameter sets the current resolution equal to that of the named raster map, and align the boundaries to a row and column edge in the named map. Alignment only moves the existing boundaries outward to the edges of the next nearest cell in the named raster map -- not to the named map's edges. To perform the latter function, use the raster=name option.
NOTES
After all updates have been applied, the raster map's resolution settings are recomputed from the boundaries and the number of rows and columns in the raster map.
The n=value may also be specified as a function of its current value: n=n+value increases the current northing, while n=n-value decreases it. This is also true for s=value, e=value, and w=value.
EXAMPLES
Assign absolute coordinates to map:
r.region map=mymap n=220750 s=220000 w=638300 e=639000
Shift map (using offset, here by +100 map units in the NS direction, -50 in the EW direction):
r.region map=mymap n=n+100 e=e-50 w=w-50 s=s+100
SEE ALSO
r.support, g.region, v.transform
AUTHOR
Glynn Clements
Based upon g.region
SOURCE CODE
Available at: r.region source code
(history)
Latest change: Monday Feb 24 16:07:55 2025 in commit 4ab71fd