| 1 | <h2>DESCRIPTION</h2> |
| 2 | |
| 3 | The function of <em>r.null</em> is to explicitly create the NULL-value |
| 4 | bitmap file. The intended usage is to update maps that do not have a |
| 5 | NULL-value bitmap file (i.e. to indicate for each pixel if zero is a valid |
| 6 | value or is to be considered as NULL, i.e. no data value). The module does |
| 7 | not work with reclassified or external maps. |
| 8 | |
| 9 | <p> |
| 10 | The design is flexible. Ranges of values can be set to NULL and/or the NULL |
| 11 | value can be eliminated and replace with a specified value. |
| 12 | <p> |
| 13 | The <b>setnull</b> parameter is used to specify values in the ranges to |
| 14 | be set to NULL. A range is either a single value (e.g., 5.3), or a pair of |
| 15 | values (e.g., 4.76-34.56). Existing NULL-values are left NULL, unless the |
| 16 | null argument is requested. |
| 17 | <p> |
| 18 | The <b>null</b> parameter eliminates the NULL value and replaces it with |
| 19 | value. This argument is applied only to existing NULL values, and not to the |
| 20 | NULLs created by the setnull argument. |
| 21 | |
| 22 | <h2>NOTES</h2> |
| 23 | |
| 24 | Note that the value is restricted to integer if the map is an integer map. |
| 25 | |
| 26 | <h3>r.null and reclassified maps</h3> |
| 27 | |
| 28 | <em>r.null</em> does not support reclassified maps because, if <em>r.null</em> |
| 29 | was run on the reclass raster it would alter the original and any other |
| 30 | reclass rasters of the original. Therefore <em>r.null</em> does not allow |
| 31 | recoding reclassified maps (products of <em>r.reclass</em>). |
| 32 | <br> |
| 33 | As a workaround, the way to recode such a map is: The user creates a raster |
| 34 | map out of the reclassified map by copying it:<br> |
| 35 | |
| 36 | <div class="code"><pre> |
| 37 | r.mapcalc "newmap = reclass" |
| 38 | </pre></div> |
| 39 | |
| 40 | <h3>NULL data compression</h3> |
| 41 | |
| 42 | By default no data files (i.e., NULL files) are not compressed unless a |
| 43 | specific environment variable is set. The NULL file compression must be |
| 44 | explicitly turned on with <code>export GRASS_COMPRESS_NULLS=1</code>.<br> |
| 45 | Warning: such raster maps can then only be opened with GRASS GIS 7.2.0 or |
| 46 | later. NULL file compression can be managed with <b>r.null -z</b>. |
| 47 | |
| 48 | <h3>External maps</h3> |
| 49 | From the <a href="r.external.html">r.external</a> documentation: GDAL-linked |
| 50 | (<em>r.external</em>) maps do not have or use a NULL bitmap, hence <em>r.null</em> cannot |
| 51 | manipulate them directly. Here NULL cells are those whose value matches |
| 52 | the value reported by the GDALGetRasterNoDataValue() function. |
| 53 | To introduce additional NULL values to a computation based on a GDAL-linked |
| 54 | raster, the user needs to either create a mask with with <em>r.mask</em> and |
| 55 | then "apply" it using e.g. <em>r.resample</em> or <em>r.mapcalc</em>, |
| 56 | or use <em>r.mapcalc</em> to create a copy with the appropriate categories |
| 57 | changed to NULL (<code>if()</code> condition). |
| 58 | |
| 59 | <h2>EXAMPLES</h2> |
| 60 | |
| 61 | Set specific values of a classified map to NULL:<br> |
| 62 | <div class="code"><pre> |
| 63 | r.null map=landcover.30m setnull=21,22 |
| 64 | </pre></div> |
| 65 | |
| 66 | Set NULL-values of a map to a specific value:<br> |
| 67 | <div class="code"><pre> |
| 68 | r.null map=fields null=99 |
| 69 | </pre></div> |
| 70 | |
| 71 | <h2>SEE ALSO</h2> |
| 72 | |
| 73 | <em> |
| 74 | <a href="r.compress.html">r.compress</a>, |
| 75 | <a href="r.support.html">r.support</a>, |
| 76 | <a href="r.quant.html">r.quant</a> |
| 77 | </em> |
| 78 | |
| 79 | <h2>AUTHOR</h2> |
| 80 | |
| 81 | U.S.Army Construction Engineering Research Laboratory |