r.external.out(1grass)

πŸ’– r.external.out β€” the manual page, but make it make sense πŸ’–

okay so bestie, you know how GRASS normally hoards all your raster maps in its own lil format inside the mapset? Yeah. This module is the glow-up that says "nah, we're writing those out as actual files using GDAL instead." r.external.out is genuinely iconic for that. ✨


πŸŽ€ NAME πŸŽ€

r.external.out β€” redirects raster output to a file utilizing the GDAL library rather than storing it in GRASS raster format. periodt. πŸ’…


🏷️ KEYWORDS 🏷️

raster, export, output, external β€” that's the vibe check, those are the tags. 🌸


πŸ“œ SYNOPSIS πŸ“œ

r.external.out
r.external.out --help
r.external.out [-frp] directory=path  [extension=string]  format=string
[options=string[,string,...]]   [--help]  [--verbose]  [--quiet]  [--ui]

🚩 Flags (the little toggles, no cap) 🚩

  • -f β€” list all the supported formats and then dip. that's it, that's the whole flag. ✨
  • -r β€” stop using GDAL and go back to native output. the "we're so back" flag. revert era. πŸ’«
  • -p β€” print the current status so you can see what's going on rn. πŸ‘€
  • --help β€” print the usage summary, bestie needs a lil reminder sometimes 🫢
  • --verbose β€” verbose module output, it's giving chatty πŸ’¬
  • --quiet β€” quiet module output, it's giving mysterious 🀫
  • --ui β€” force launch the GUI dialog, for the visual learners among us πŸ–₯️

🧸 Parameters (the actual inputs, your main character args) 🧸

  • directory=path [required] β€” name of the output directory. yes it's required, no you can't skip it πŸ™ˆ
  • extension=string β€” the extension for your output files. cute lil suffix πŸŽ€
  • format=string [required] β€” the format of your output files. pick your fighter (full roster below):

Options: GTiff, COG, VRT, NITF, HFA, AAIGrid, DTED, PNG, JPEG, MEM, GIF, FITS, BMP, PCIDSK, PCRaster, ILWIS, SRTMHGT, Leveller, Terragen, netCDF, HDF4Image, ISIS3, PDS4, VICAR, ERS, JP2OpenJPEG, GRIB, RMF, WMS, RST, GSAG, GSBG, GS7BG, KMLSUPEROVERLAY, WEBP, PDF, MBTiles, CALS, WMTS, MRF, PNM, BT, LCP, GTX, KRO, ROI_PAC, RRASTER, BAG, S102, S104, S111, NWT_GRD, PostGISRaster, SAGA, XYZ, HF2, ZMap, SIGDEM, AVIF, HEIF, JPEGXL, GPKG, OpenFileGDB, NGW, ENVI, EHdr, ISCE, Zarr, MiraMonRaster β€” that's the whole alphabet of formats fr fr πŸ”₯

  • options=string[,string,...] β€” creation options. you can pass a whole lil comma-separated stack of them ⭐

🌈 DESCRIPTION 🌈

r.external.out straight up tells GRASS: bestie, from now on, every raster map you generate? Write it out as a data file (think GeoTIFF) using GDAL, not as a GRASS raster format file in the current mapset. new rule, we're doing it this way now. πŸ’…

And the way that any brand-new raster map is immediately written out through GDAL as a file? iconic behaviour honestly. no queue, no waiting, it just goes. ✨


πŸ“ NOTES πŸ“

okay this part matters so listen up bestie:

  • A relative directory path (that's the directory parameter) gets interpreted relative to the current mapset directory β€” not the current directory where you launched the command. sneaky, right? 😭
  • If the directory is unspecified or empty (which, btw, happens if you just pass a simple filename for output), then your output file lands in the "gdal/" subdirectory of the current mapset directory. so it still ends up somewhere, just not where you'd guess. 🫢

🌟 EXAMPLES 🌟

Storing results from raster data analysis directly as GeoTIFF πŸ’Ύ

So r.external.out is the module you use to write out processing results directly in GeoTIFF format β€” and btw, any GDAL supported format can be used here, not just GeoTIFF. slay. 🌈

# define output directory for files resulting from GRASS calculation(s)
# and target format:
mkdir $HOME/gisoutput/
# hint: the create options are not mandatory
r.external.out directory=$HOME/gisoutput/ format="GTiff" option="BIGTIFF=YES,COMPRESS=DEFLATE"
# prepare sample analysis
g.region raster=elevation -p
# perform GRASS calculation (here: filter by height, write > 120m, NULL otherwise)
# this will store the output map directly as GeoTIFF, so we use .tif extension:
r.mapcalc "elev_filt.tif = if(elevation > 120.0, elevation, null() )"
# ...the "elev_filt.tif" is immediately written.
# cease GDAL output connection and turn back to write out GRASS raster files:
r.external.out -r
# verify resulting file
gdalinfo $HOME/gisoutput/elev_filt.tif

Complete workflow using only external geodata while processing in GRASS πŸ¦‹

r.external.out also teams up with r.external β€” so you can process external geodata inside GRASS while writing the results out directly in GeoTIFF. dream team fr. 🫢

# register GeoTIFF file to be used in current mapset:
r.external input=terra_lst1km20030314.LST_Day.tif output=modis_celsius
# define output directory for files resulting from GRASS calculation:
r.external.out directory=$HOME/gisoutput/ format="GTiff"
# perform GRASS calculation (here: extract pixels > 20 deg C)
# this stores the output map directly as GeoTIFF:
r.mapcalc "warm.tif = if(modis_celsius > 20.0, modis_celsius, null() )"
# cease GDAL output connection and turn back to write out GRASS raster files:
r.external.out -r
# now use the resulting file elsewhere
gdalinfo $HOME/gisoutput/warm.tif

πŸ”— REFERENCES πŸ”—


πŸ‘€ SEE ALSO πŸ‘€

r.in.gdal, r.out.gdal, r.external β€” the whole squad, go check them out too πŸ’œ


πŸ‘‘ AUTHOR πŸ‘‘

Glynn Clements β€” the legend responsible for this one. we stan. 🫑


πŸ’» SOURCE CODE πŸ’»

Available at: r.external.out source code (history) β€” go peek if you're nosy, no judgement 🌸

Latest change: Thursday Dec 04 09:43:11 2025 in commit: 8b4d7c3e310ec3122a5e870e724c50bd716f9513

Main index | Raster index | Topics index | Keywords index | Graphical index | Full index


okay and that's the whole page bestie!! πŸŽ€ Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual β€” this was r.external.out(1grass) from the GRASS 8.5.0 era, last touched Thursday Dec 04 09:43:11 2025 in that commit 8b4d7c3e310ec3122a5e870e724c50bd716f9513. now go write some GeoTIFFs and slay πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from