r.region(1grass)
π r.region β a.k.a. the "let me fix your raster boundaries bestie" era π
okay so real talk, this one is from the GRASS User's Manual, and it's literally the glow-up tool for raster map boundaries. No cap. Let's get into it π«Ά
β¨ NAME β¨
r.region β sets the boundary definitions for a raster map. that's it, that's the whole job, and she does it flawlessly π
πΈ KEYWORDS πΈ
raster, metadata, geometry β the holy trinity, honestly
π¦ SYNOPSIS π¦
r.region
r.region --help
r.region [-cda] map=name [region=name] [raster=name] [vector=name]
[n=value] [s=value] [e=value] [w=value] [align=name] [--help]
[--verbose] [--quiet] [--ui]
π Flags π
-cβ set from the current region. yes queen, take what's already there-dβ set from the default region. the classic, the blueprint, the blueprint-y one-aβ auto-adjustment for lat/lon. she will attempt to fix small precision errors in resolution and extents, which is giving "I'll try my best" energy but honestly it usually eats--helpβ print usage summary. your emergency contact fr fr--verboseβ verbose module output. she will NOT stop talking and honestly? we love that--quietβ quiet module output. shhh era--uiβ force launching GUI dialog. for the visual learners π¨
π Parameters π
map=name(required) β name of the raster map to change. this one is mandatory bestie, you cannot skip it, the tool will simply not engageregion=nameβ set region from a named regionraster=nameβ set region to match this raster mapvector=nameβ name of vector map; sets region to match this vector mapn=valueβ value for the northern edges=valueβ value for the southern edgee=valueβ value for the eastern edgew=valueβ value for the western edgealign=nameβ raster map to align to
π DESCRIPTION π
So the whole ~vibe~ of r.region is that it lets you manage the boundaries of a raster map. You can set those boundaries directly by hand, or you can pull them from:
- a region definition file (which lives under the
windowsdirectory in the user's current mapset), - a raster map,
- a vector map,
- or a 3dview file.
And now, the align parameter β this is the main character. align sets the current resolution equal to that of the named raster map, and then aligns the boundaries to a row and column edge in that named map. Important caveat tho π¨: 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. If that latter thing is what you're after, you need the raster=name option instead. so like, know the difference, iykyk π
π NOTES π
After all the updates have been applied, the raster map's resolution settings get recomputed from the boundaries and the number of rows and columns in the raster map. she recalcs herself, it's giving self-sufficient π§
Also! 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. And yes, this same trick is also true for s=value, e=value, and w=value. relative math, periodt β¨
π₯ EXAMPLES π₯
Assign absolute coordinates to a map:
r.region map=mymap n=220750 s=220000 w=638300 e=639000
Shift a map (using offset β here by +100 map units in the NS direction, and -50 in the EW direction):
r.region map=mymap n=n+100 e=e-50 w=w-50 s=s+100
see how she just... slid over? iconic behavior honestly π¦
π« 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: 4ab71fd34113b347c3c86c736cd82ca0f6be1d4b
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
that's the whole page bestie, go forth and fix those boundaries π
okay and for the cute sign-off: this whole thing is living under GRASS 8.5.0 (the Reference Manual, no less), Β© 2003-2026 GRASS Development Team β and the r.region(1grass) footer says GRASS 8.5.0 too, so she's consistent, she's committed, she's aligned ππ«Ά
π¦ where this page comes from
- alpine 3.24: grass-gis-doc 8.5.0-r1 Β· GPL-2.0-or-later
- ubuntu stonking: grass-doc 8.5.0-1ubuntu1 Β· 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