Is Null (Image Analyst)

Available with Spatial Analyst license.

Available with Image Analyst license.

Summary

Determines which values from the input raster are NoData on a cell-by-cell basis.

Returns a value of 1 if the input value is NoData and 0 for cells that are not.

Illustration

Is Null illustration
OutRas = IsNull(InRas1)

Usage

  • Is Null can be used along with the Con tool to change NoData cells to a value.

  • If the input is a multiband raster, the output will be a multiband raster. The tool will perform the operation on each band in the input.

  • If the input is multidimensional raster data, all slices from all variables will be processed. The output will be a multidimensional raster in CRF format.

Parameters

LabelExplanationData Type
Input raster

The input raster being tested to identify the cells that are NoData (null).

The input can be either integer or floating-point type.

Raster Layer

Return Value

LabelExplanationData Type
Output raster

The output raster.

The output identifies with an integer value of 1 which cells in the input are NoData. If the input is any other value, the output is 0.

Raster

IsNull(in_raster)
NameExplanationData Type
in_raster

The input raster being tested to identify the cells that are NoData (null).

The input can be either integer or floating-point type.

Raster Layer

Return Value

NameExplanationData Type
out_raster

The output raster.

The output identifies with an integer value of 1 which cells in the input are NoData. If the input is any other value, the output is 0.

Raster

Code sample

IsNull example 1 (Python window)

This example identifies which cells in the input raster are NoData, and outputs the result as an IMG raster.

import arcpy
from arcpy import env
from arcpy.ia import *
env.workspace = "C:/iapyexamples/data"
outIsNull = IsNull("degs")
outIsNull.save("C:/iapyexamples/output/outisnull.img")
IsNull example 2 (stand-alone script)

This example identifies which cells in the input raster are NoData, and outputs the result as a Grid raster.

# Name: IsNull_Ex_02.py
# Description: Find which pixels of the input raster are NoData
# Requirements: Image Analyst Extension

# Import system modules
import arcpy
from arcpy import env
from arcpy.ia import *

# Set environment settings
env.workspace = "C:/iapyexamples/data"

# Set local variables
inRaster = "degs"

# Check out the ArcGIS Image Analyst extension license
arcpy.CheckOutExtension("ImageAnalyst")

# Execute IsNull
outIsNull = IsNull(inRaster)

# Save the output 
outIsNull.save("C:/iapyexamples/output/outisnull")

Licensing information

  • Basic: Requires Image Analyst or Spatial Analyst
  • Standard: Requires Image Analyst or Spatial Analyst
  • Advanced: Requires Image Analyst or Spatial Analyst

Related topics