1r.null(1) GRASS GIS User's Manual r.null(1)
2
3
4
6 r.null - Manages NULL-values of given raster map.
7
9 raster, map management, null data, no-data
10
12 r.null
13 r.null --help
14 r.null [-fincrz] map=name [setnull=val[-val][,val[-val],...]]
15 [null=float] [--help] [--verbose] [--quiet] [--ui]
16
17 Flags:
18 -f
19 Only do the work if the map is floating-point
20
21 -i
22 Only do the work if the map is integer
23
24 -n
25 Only do the work if the map doesn’t have a NULL-value bitmap file
26
27 -c
28 Create NULL-value bitmap file validating all data cells
29
30 -r
31 Remove NULL-value bitmap file
32
33 -z
34 Re-create NULL-value bitmap file (to compress or uncompress)
35
36 --help
37 Print usage summary
38
39 --verbose
40 Verbose module output
41
42 --quiet
43 Quiet module output
44
45 --ui
46 Force launching GUI dialog
47
48 Parameters:
49 map=name [required]
50 Name of raster map for which to edit null values
51
52 setnull=val[-val][,val[-val],...]
53 List of cell values to be set to NULL
54
55 null=float
56 The value to replace the null value by
57
59 The function of r.null is to explicitly create the NULL-value bitmap
60 file. The intended usage is to update maps that do not have a
61 NULL-value bitmap file (i.e. to indicate for each pixel if zero is a
62 valid value or is to be considered as NULL, i.e. no data value). The
63 module does not work with reclassified or external maps.
64
65 The design is flexible. Ranges of values can be set to NULL and/or the
66 NULL value can be eliminated and replace with a specified value.
67
68 The setnull parameter is used to specify values in the ranges to be set
69 to NULL. A range is either a single value (e.g., 5.3), or a pair of
70 values (e.g., 4.76-34.56). Existing NULL-values are left NULL, unless
71 the null argument is requested.
72
73 The null parameter eliminates the NULL value and replaces it with
74 value. This argument is applied only to existing NULL values, and not
75 to the NULLs created by the setnull argument.
76
78 Note that the value is restricted to integer if the map is an integer
79 map.
80
81 r.null and reclassified maps
82 r.null does not support reclassified maps because, if r.null was run on
83 the reclass raster it would alter the original and any other reclass
84 rasters of the original. Therefore r.null does not allow recoding re‐
85 classified maps (products of r.reclass).
86 As a workaround, the way to recode such a map is: The user creates a
87 raster map out of the reclassified map by copying it:
88 r.mapcalc "newmap = reclass"
89
90 NULL data compression
91 By default no data files (i.e., NULL files) are not compressed unless a
92 specific environment variable is set. The NULL file compression must be
93 explicitly turned on with export GRASS_COMPRESS_NULLS=1.
94 Warning: such raster maps can then only be opened with GRASS GIS 7.2.0
95 or later. NULL file compression can be managed with r.null -z.
96
97 External maps
98 From the r.external documentation: GDAL-linked (r.external) maps do not
99 have or use a NULL bitmap, hence r.null cannot manipulate them di‐
100 rectly. Here NULL cells are those whose value matches the value re‐
101 ported by the GDALGetRasterNoDataValue() function. To apply the
102 GDAL-linked the user need to either create a MASK (e.g. with r.mask)
103 and then "apply" it using e.g. r.resample, or use r.mapcalc to create a
104 copy with the appropriate categories changed to NULL (if() condition).
105
107 Set specific values of a classified map to NULL:
108 r.null map=landcover.30m setnull=21,22
109 Set NULL-values of a map to a specific value:
110 r.null map=fields null=99
111
113 r.compress, r.support, r.quant
114
116 U.S.Army Construction Engineering Research Laboratory
117
119 Available at: r.null source code (history)
120
121 Accessed: Saturday Jan 21 20:38:43 2023
122
123 Main index | Raster index | Topics index | Keywords index | Graphical
124 index | Full index
125
126 © 2003-2023 GRASS Development Team, GRASS GIS 8.2.1 Reference Manual
127
128
129
130GRASS 8.2.1 r.null(1)