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 [-fojeahvt] [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 --overwrite
49 Allow output files to overwrite existing files
50
51 --help
52 Print usage summary
53
54 --verbose
55 Verbose module output
56
57 --quiet
58 Quiet module output
59
60 --ui
61 Force launching GUI dialog
62
63 Parameters:
64 input=name
65 Name of raster file to be linked
66
67 source=name
68 Name of non-file GDAL data source
69
70 output=name [required]
71 Name for output raster map
72
73 band=integer
74 Band to select (default is all bands)
75
76 title=phrase
77 Title for resultant raster map
78
80 r.external allows a user to link a GDAL supported raster file to a
81 binary raster map layer, from any GDAL supported raster map format,
82 with an optional title. The file is not imported but just registered as
83 GRASS raster map.
84
86 In essence, r.external creates a read-only link to the original dataset
87 which is only valid if the original dataset remains at the originally
88 indicated directory and filename.
89
91 GDAL-linked (r.external) maps do not have or use a NULL bitmap, hence
92 r.null cannot manipulate them directly. Here NULL cells are those whose
93 value matches the value reported by the GDALGetRasterNoDataValue()
94 function. To apply the GDAL-linked the user need to either create a
95 MASK (e.g. with r.mask) and then "apply" it using e.g. r.resample, or
96 use r.mapcalc to create a copy with the appropriate categories changed
97 to NULL (if() condition).
98
100 RGB Orthophoto from GeoTIFF
101 # import of all channels (each channel will become a GRASS raster map):
102 r.external input=/home/user/data/maps/059100.tif output=ortho
103 g.region raster=ortho.3 -p
104 d.rgb r=ortho.1 g=ortho.2 b=ortho.3
105 r.composite r=ortho.1 g=ortho.2 b=ortho.3 output=ortho.rgb
106
107 Processing workflow without data import and export
108 External raster maps to be processed can be directly linked using
109 r.external; likewise, results can be written out to standard raster
110 formats with r.external.out (GDAL supported formats):
111 # register GeoTIFF file to be used in current mapset:
112 r.external input=terra_lst1km20030314.LST_Day.tif output=modis_celsius
113 # define output directory for files resulting from GRASS calculation:
114 r.external.out directory=$HOME/gisoutput/ format="GTiff"
115 # perform GRASS calculation (here: extract pixels > 20 deg C)
116 # this stores the output map directly as GeoTIFF:
117 r.mapcalc "warm.tif = if(modis_celsius > 20.0, modis_celsius, null() )"
118 # cease GDAL output connection and turn back to write GRASS raster files:
119 r.external.out -r
120 # now use the resulting file elsewhere
121 gdalinfo $HOME/gisoutput/warm.tif
122
124 GDAL Pages: http://www.gdal.org/
125
127 r.import, r.in.gdal, r.external.out
128
129 v.import, v.in.ogr, v.external, v.external.out
130
132 Glynn Clements
133
135 Available at: r.external source code (history)
136
137 Main index | Raster index | Topics index | Keywords index | Graphical
138 index | Full index
139
140 © 2003-2020 GRASS Development Team, GRASS GIS 7.8.5 Reference Manual
141
142
143
144GRASS 7.8.5 r.external(1)