1r.external.out(1) GRASS GIS User's Manual r.external.out(1)
2
3
4
6 r.external.out - Redirects raster output to file utilizing GDAL li‐
7 brary rather than storing in GRASS raster format.
8
10 raster, export, output, external
11
13 r.external.out
14 r.external.out --help
15 r.external.out [-frp] directory=path [extension=string] format=string
16 [options=string[,string,...]] [--help] [--verbose] [--quiet]
17 [--ui]
18
19 Flags:
20 -f
21 List supported formats and exit
22
23 -r
24 Cease using GDAL and revert to native output
25
26 -p
27 Print current status
28
29 --help
30 Print usage summary
31
32 --verbose
33 Verbose module output
34
35 --quiet
36 Quiet module output
37
38 --ui
39 Force launching GUI dialog
40
41 Parameters:
42 directory=path [required]
43 Name of output directory
44
45 extension=string
46 Extension for output files
47
48 format=string [required]
49 Format of output files
50 Options: VRT, GTiff, COG, NITF, HFA, ELAS, AAIGrid, DTED, PNG, GTA,
51 JPEG, MEM, GIF, FITS, XPM, BMP, PCIDSK, PCRaster, ILWIS, SGI,
52 SRTMHGT, Leveller, Terragen, netCDF, HDF4Image, ISIS3, ISIS2, PDS4,
53 VICAR, ERS, JP2OpenJPEG, FIT, GRIB, RMF, WMS, RST, GSAG, GSBG,
54 GS7BG, R, KMLSUPEROVERLAY, WEBP, PDF, Rasterlite, MBTiles, CALS,
55 WMTS, MRF, PNM, PAux, MFF, MFF2, BT, LAN, LCP, GTX, NTv2, CTable2,
56 KRO, ROI_PAC, RRASTER, BYN, ARG, USGSDEM, BAG, NWT_GRD, ADRG, BLX,
57 PostGISRaster, SAGA, XYZ, HF2, ZMap, SIGDEM, EXR, GPKG, NGW, ENVI,
58 EHdr, ISCE, Zarr
59
60 options=string[,string,...]
61 Creation options
62
64 r.external.out instructs GRASS GIS to write subsequently generated
65 raster maps as data files (e.g. GeoTIFF) using GDAL instead of storing
66 them in GRASS raster format in the current mapset.
67
68 Any new raster map is immediately written out through GDAL as a file.
69
71 A relative directory path (parameter directory) is interpreted relative
72 to the current mapset directory, not the current directory where the
73 command was launched. An unspecified or empty directory (which will oc‐
74 cur if the user passes a simple filename for output) results in the
75 output file being placed in the "gdal/" subdirectory of the current
76 mapset directory.
77
79 Storing results from raster data analysis directly as GeoTIFF
80 The module r.external.out is used to write out processing results di‐
81 rectly in GeoTIFF format (any GDAL supported format can be used here):
82 # define output directory for files resulting from GRASS calculation(s)
83 # and target format:
84 mkdir $HOME/gisoutput/
85 # hint: the create options are not mandatory
86 r.external.out directory=$HOME/gisoutput/ format="GTiff" option="BIGTIFF=YES,COMPRESS=DEFLATE"
87 # prepare sample analysis
88 g.region raster=elevation -p
89 # perform GRASS calculation (here: filter by height, write > 120m, NULL otherwise)
90 # this will store the output map directly as GeoTIFF, so we use .tif extension:
91 r.mapcalc "elev_filt.tif = if(elevation > 120.0, elevation, null() )"
92 # ...the "elev_filt.tif" is immediately written.
93 # cease GDAL output connection and turn back to write out GRASS raster files:
94 r.external.out -r
95 # verify resulting file
96 gdalinfo $HOME/gisoutput/elev_filt.tif
97
98 Complete workflow using only external geodata while processing in GRASS GIS
99 The module r.external.out can be used along with r.external to process
100 external geodata in GRASS while writing out the results directly in
101 GeoTIFF:
102 # register GeoTIFF file to be used in current mapset:
103 r.external input=terra_lst1km20030314.LST_Day.tif output=modis_celsius
104 # define output directory for files resulting from GRASS calculation:
105 r.external.out directory=$HOME/gisoutput/ format="GTiff"
106 # perform GRASS calculation (here: extract pixels > 20 deg C)
107 # this stores the output map directly as GeoTIFF:
108 r.mapcalc "warm.tif = if(modis_celsius > 20.0, modis_celsius, null() )"
109 # cease GDAL output connection and turn back to write GRASS raster files:
110 r.external.out -r
111 # now use the resulting file elsewhere
112 gdalinfo $HOME/gisoutput/warm.tif
113
115 GDAL Pages: http://www.gdal.org/
116
118 r.in.gdal, r.out.gdal, r.external
119
121 Glynn Clements
122
124 Available at: r.external.out source code (history)
125
126 Accessed: Saturday Jan 21 21:14:33 2023
127
128 Main index | Raster index | Topics index | Keywords index | Graphical
129 index | Full index
130
131 © 2003-2023 GRASS Development Team, GRASS GIS 8.2.1 Reference Manual
132
133
134
135GRASS 8.2.1 r.external.out(1)