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
directoryparameter) 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 π
- GDAL Pages:
https://gdal.org/β go read up, iykyk π
π 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
- 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