r.mask.status(1)

πŸ“¦
version 8.5.0 Β· 2 versions
, in nixos 26.05

πŸ’… 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 code 0 when the mask is present, 1 otherwise. like, behave like the test utility: 0 for true, 1 for 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) 🌈

πŸ‘‘ 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 present boolean in JSON πŸ”₯
  • what raster name is used to represent the mask β†’ the name string in JSON
  • whether the raster is reclassified from another β†’ is_reclass_of string (or null) 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 -t flag, no output is printed at all. instead, a return code indicates presence or absence. the convention is the same as the POSIX test utility β€” so r.mask.status returns 0 when the mask is present and 1 otherwise. (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