r.external.out(1)
π r.external.out β the GRASS GIS user's manual page, bestie edition π
okay so you know how GRASS normally hoards all your rasters in its own lil format? yeah. this module is the glow-up. r.external.out redirects raster output to a file using the GDAL library instead of storing stuff in GRASS raster format. it's giving "let my maps be free" energy. β¨
πΈ KEYWORDS πΈ
raster, export, output, external
β¨ 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
-fβ lists all the supported formats and then dips. that's it, that's the flag.-rβ stops using GDAL and reverts back to native output. the "we're so back" flag.-pβ prints the current status. vibe check on your setup. π--helpβ prints the usage summary.--verboseβ verbose module output (aka it yaps more).--quietβ quiet module output (aka it shuts up).--uiβ forces the GUI dialog to launch.
π¦ Parameters
directory=path[required] β name of the output directory.extension=stringβ extension for output files.format=string[required] β the format of your output files. here's the whole menu, no cap:GTiff,COG,VRT,NITF,HFA,AAIGrid,DTED,PNG,GTA,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,NWT_GRD,PostGISRaster,SAGA,XYZ,HF2,ZMap,SIGDEM,EXR,GPKG,OpenFileGDB,NGW,ENVI,EHdr,ISCE,Zarr. pick your fighter. πoptions=string[,string,...]β creation options.
π DESCRIPTION π
so basically, r.external.out tells GRASS GIS to write every raster map you make from now on as a data file (think GeoTIFF, bestie) using GDAL, instead of tucking it away in GRASS raster format inside the current mapset.
any new raster map? immediately written out through GDAL as a file. instantly. no waiting around. main character behavior fr fr. π₯
π NOTES π
a relative directory path (that's the directory parameter) gets interpreted relative to the current mapset directory, not the current directory where you actually ran the command. yes, this trips people up. no, it's not a bug, it's just like that. π
and if you leave directory unspecified or empty (which is what happens if you just pass a plain filename for your output), the output file lands in the "gdal/" subdirectory of the current mapset directory. cute lil default home for your files. π
π EXAMPLES π
π Storing results from raster data analysis directly as GeoTIFF
r.external.out is used to write out processing results directly in GeoTIFF format (tho any GDAL supported format can be used here, periodt):
# 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 GIS
the module r.external.out can be used along with r.external to process external geodata in GRASS while writing out the results directly in GeoTIFF. the collab we deserved:
# 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/
π« SEE ALSO π«
r.in.gdal, r.out.gdal, r.external
π AUTHOR π
Glynn Clements
β SOURCE CODE β
Available at: r.external.out source code (history)
Accessed: Saturday Jan 17 05:40:45 2026
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual
and that's the whole page bestie π this was the GRASS 8.4.2 Reference Manual, accessed Saturday Jan 17 05:40:45 2026, Β© 2003-2025 GRASS Development Team. go write some external rasters, you absolute icon π«Άβ¨
π¦ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 Β· 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