NoData in raster datasets
Cell values can be either positive or negative, integer, or floating point. Cells can also have a NoData value to represent the absence of data. Sometimes there are homogeneous areas in a raster dataset that the you do not want to display. These can include borders, backgrounds, or other data considered to not have valid values. Sometimes these are expressed as NoData values, although other times they may have real values.
When displaying rasters with NoData values, all renderers allow you to set the NoData value to a color or no color; however, the Stretched renderer allows you to identify a specific background value and display color or no color.
Learn about symbolizing values of NoData in raster datasets
When calculating the statistics for a raster dataset, you can choose to ignore any cells with NoData.
When performing operations on raster data containing NoData values, there are typically three ways that NoData is treated for each cell:
- NoData can be returned for the location no matter what
- NoData is ignored, and a value is computed using any available values
- A value must be estimated, and NoData cannot be returned
Storing NoData
NoData is stored as a mask that is part of the raster dataset, or using a pixel value in the dataset that is not used as a valid value elsewhere in the dataset. For example, -9999 is a common value for storing NoData.
In ArcSDE and file geodatabases, if the original raster data contains NoData cells, a bit mask will be generated when loading the raster, and it will be stored in the database. The bit mask will be read, and NoData areas will be extracted at the time of retrieval.
When NoData is added to a file-based raster that already has a full-bit range (meaning that all the values in the bit range, for example, 0 to 255, are all represented by at least one cell), it will be promoted to the next higher bit depth. For example, a hillshade grid with cell values of 0 to 255, which then has NoData added to it, will be represented as unsigned 16 bit in order to store a value that is not being used to represent a valid value, such as 256. The following table lists the rules for data type promotion:
Original file-based raster data type |
Data type after loading to geodatabase |
---|---|
Unsigned 1-bit integer |
Unsigned 4-bit integer |
Unsigned 4-bit integer |
Unsigned 8-bit integer |
Unsigned 8-bit integer |
Unsigned 16-bit integer |
Signed 8-bit integer |
Signed 16-bit integer |
Unsigned 16-bit integer |
Unsigned 32-bit integer |
Signed 16-bit integer |
Signed 32-bit integer |
Unsigned 32-bit integer |
Floating point 32-bit |
Signed 32-bit integer |
Floating point 32-bit |
Defining NoData
There are two ways to assign the cell value in a raster dataset to be NoData—using the Set Null tool or through the raster dataset's Properties dialog box. You can also remove a value from being NoData using the raster dataset's Properties dialog box.
NoData values can also be assigned for a mosaic dataset using the Define Mosaic Dataset NoData tool. This tool allows you to specify more than one NoData value.
Editing a raster dataset's NoData value
- In the ArcCatalog or the Catalog window, right-click the raster dataset and click Properties.
- On the General tab, under Raster Information is the NoData Value. Click the Edit button.
The NoData Editor dialog box is opened.
- Click the column next to the band name to edit the NoData Value.
- You must enter a value contained within the dataset.
- Only one value can be entered for each band.
- You can specify a different value for each band.
- Alternatively, you can clear the value entered to remove the NoData value.
Caution:Be careful not to specify a value that is also valid within the dataset. For example, 0 may be used as a default value for cells that don't have a valid value, but 0 may also be used to define valid values in the raster dataset. If this is the case you may need to define a mask. For more information, see the Mask environment setting or the Mask function.
- If you don't know the value to enter, you can click the Compute button and the application will choose the appropriate value.
- Click OK to close the dialog boxes.