r.mask.status(1)
π r.mask.status β the GRASS User's Manual tea π«
okay bestie, so you know how r.mask.status exists? it's a whole module from the GRASS User's Manual, and it's here to answer the question we ALL ask: is there a mask or not π
β¨ NAME β¨
r.mask.status β reports presence or absence of a raster mask, and yeah, it "provides information about the presence of a 2D raster mask as text output or return code" π
π KEYWORDS π
raster, mask, reclassification β literally the whole vibe in three words, no cap.
πΈ SYNOPSIS πΈ
r.mask.status
r.mask.status --help
r.mask.status [-t] [format=string] [--help] [--verbose] [--quiet]
[--ui]
π¦ Flags
-tβ return code0when the mask is present,1otherwise. like, behave like the test utility:0for true,1for false, and no output at all. silence is golden β¨--helpβ print usage summary π«Ά--verboseβ verbose module output (she talks more π¬)--quietβ quiet module output (she talks less π€«)--uiβ force launching GUI dialog π₯οΈ
π Parameters
format=stringβ the format for reporting.- Options:
plain,json,shell,yaml - Default:
plain plain: plain text output πjson: JSON (JavaScript Object Notation) π§©shell: shell script style output πyaml: YAML (human-friendly data serialization language) π
- Options:
π DESCRIPTION π
so r.mask.status reports information about the 2D raster mask and its status. basically it tells you whether the mask is present or not. periodt. π
for both an active and an inactive mask, the tool reports the full name of the raster β that's the name including the mapset, iykyk β which represents, or would represent, the mask. it can also report the full name of the underlying raster if the mask is reclassified from another raster, which is kind of iconic ngl.
the tool is your go-to for checking:
- if the mask is currently set β the
presentboolean in JSON π₯ - what raster name is used to represent the mask β the
namestring in JSON - whether the raster is reclassified from another β
is_reclass_ofstring (ornull) in JSON
the YAML and shell script style outputs follow the JSON output if possible. the plain text format outputs multi-line human-readable information in natural language β like she's just texting you the answer π
β οΈ heads up: with the-tflag, no output is printed at all. instead, a return code indicates presence or absence. the convention is the same as the POSIXtestutility β sor.mask.statusreturns0when the mask is present and1otherwise. (the original page says "same same" here, and honestly? relatable. π)
π EXAMPLES π
π§ Generate JSON output
to generate JSON output in Bash, use the format option:
r.mask.status format=json
in Python, use:
import grass.script as gs
gs.parse_command("r.mask.status", format="json")
this returns a dictionary with keys present, full_name, and is_reclass_of π
π Use as the test utility
the POSIX test utility uses return code 0 to indicate presence and 1 to indicate absence of a file, so testing existence of a file with test -f gives return code 0 when the file exists. r.mask.status can be used the same way with the -t flag:
r.mask.status -t
in a Bash script:
# Bash
if r.mask.status -t; then
echo "Masking is active"
else
echo "Masking is not active"
fi
she ate that fr fr π₯
π SEE ALSO π
r.mask, g.region β go give them a read bestie π«Ά
π AUTHORS π
Vaclav Petras, NC State University, Center for Geospatial Analytics β main character energy tbh π
β SOURCE CODE β
available at: r.mask.status source code (history) π§Ύ
accessed: Saturday Oct 31 11:07:33 2026 ποΈ
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual π
and that's the whole page, bestie β¨ mwah π β signed off from GRASS 8.5.0, dated Saturday Oct 31 11:07:33 2026, brought to you by the GRASS Development Team (Β© 2003-2026) ππ¦πΈ
π¦ where this page comes from
- nixos 26.05: grass 8.5.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms