1r.external(1) GRASS GIS User's Manual r.external(1)
2
3
4
6 r.external - Links GDAL supported raster data as a pseudo GRASS raster
7 map.
8
10 raster, import, external
11
13 r.external
14 r.external --help
15 r.external [-fojeahvtmr] [input=name] [source=name] output=name
16 [band=integer] [title=phrase] [--overwrite] [--help] [--verbose]
17 [--quiet] [--ui]
18
19 Flags:
20 -f
21 List supported formats and exit
22
23 -o
24 Override projection check (use current location’s projection)
25 Assume that the dataset has same projection as the current location
26
27 -j
28 Perform projection check only and exit
29
30 -e
31 Extend region extents based on new dataset
32 Also updates the default region if in the PERMANENT mapset
33
34 -a
35 Auto-adjustment for lat/lon
36 Attempt to fix small precision errors in resolution and extents
37
38 -h
39 Flip horizontally
40
41 -v
42 Flip vertically
43
44 -t
45 List available bands including band type in dataset and exit
46 Format: band number,type,projection check
47
48 -m
49 Read data range from metadata
50 WARNING: metadata are sometimes approximations with wrong data
51 range
52
53 -r
54 Create fast link without data range
55 WARNING: some modules do not work correctly without known data
56 range
57
58 --overwrite
59 Allow output files to overwrite existing files
60
61 --help
62 Print usage summary
63
64 --verbose
65 Verbose module output
66
67 --quiet
68 Quiet module output
69
70 --ui
71 Force launching GUI dialog
72
73 Parameters:
74 input=name
75 Name of raster file to be linked
76
77 source=name
78 Name of non-file GDAL data source
79
80 output=name [required]
81 Name for output raster map
82
83 band=integer
84 Band to select (default is all bands)
85
86 title=phrase
87 Title for resultant raster map
88
90 r.external allows a user to link a GDAL supported raster file to a bi‐
91 nary raster map layer, from any GDAL supported raster map format, with
92 an optional title. The file is not imported but just registered as
93 GRASS raster map.
94
96 In essence, r.external creates a read-only link to the original dataset
97 which is only valid if the original dataset remains at the originally
98 indicated directory and filename.
99
101 GDAL-linked (r.external) maps do not have or use a NULL bitmap, hence
102 r.null cannot manipulate them directly. Here NULL cells are those whose
103 value matches the value reported by the GDALGetRasterNoDataValue()
104 function. To apply the GDAL-linked the user need to either create a
105 MASK (e.g. with r.mask) and then "apply" it using e.g. r.resample, or
106 use r.mapcalc to create a copy with the appropriate categories changed
107 to NULL (if() condition).
108
110 RGB Orthophoto from GeoTIFF
111 # import of all channels (each channel will become a GRASS raster map):
112 r.external input=/home/user/data/maps/059100.tif output=ortho
113 g.region raster=ortho.3 -p
114 d.rgb r=ortho.1 g=ortho.2 b=ortho.3
115 r.composite r=ortho.1 g=ortho.2 b=ortho.3 output=ortho.rgb
116
117 Processing workflow without data import and export
118 External raster maps to be processed can be directly linked using r.ex‐
119 ternal; likewise, results can be written out to standard raster formats
120 with r.external.out (GDAL supported formats):
121 # register GeoTIFF file to be used in current mapset:
122 r.external input=terra_lst1km20030314.LST_Day.tif output=modis_celsius
123 # define output directory for files resulting from GRASS calculation:
124 r.external.out directory=$HOME/gisoutput/ format="GTiff"
125 # perform GRASS calculation (here: extract pixels > 20 deg C)
126 # this stores the output map directly as GeoTIFF:
127 r.mapcalc "warm.tif = if(modis_celsius > 20.0, modis_celsius, null() )"
128 # cease GDAL output connection and turn back to write GRASS raster files:
129 r.external.out -r
130 # now use the resulting file elsewhere
131 gdalinfo $HOME/gisoutput/warm.tif
132
134 GDAL Pages: http://www.gdal.org/
135
137 r.import, r.in.gdal, r.external.out
138
139 v.import, v.in.ogr, v.external, v.external.out
140
142 Glynn Clements
143
145 Available at: r.external source code (history)
146
147 Accessed: Saturday Jan 21 21:14:34 2023
148
149 Main index | Raster index | Topics index | Keywords index | Graphical
150 index | Full index
151
152 © 2003-2023 GRASS Development Team, GRASS GIS 8.2.1 Reference Manual
153
154
155
156GRASS 8.2.1 r.external(1)