Show Navigation | Hide Navigation
You are here:
Extensions > Spatial Analyst > Spatial Analyst functional reference > Math Logical (Spatial Analyst)

Is Null

Release 9.3
Last modified September 7, 2011
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Math Logical (Spatial Analyst)"


Related Topics

Returns 1 if the input value is NoData and 0 for cells that are not, on a cell-by-cell basis within the Analysis window.

Learn more about how Is Null works


Illustration


Is Null illustration

Map Algebra:
OutRas = IsNull(InRas1)
Command Line:
IsNull_sa InRas1 OutRas

Usage tips

Command line syntax
An overview of the Command Line window
IsNull_sa <in_raster> <out_raster>

Parameter Explanation Data Type
<in_raster>

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

Composite Geodataset
<out_raster>

The output raster. Where cell values in the input are NoData, the output value will be 1. If it is any other value, the output value will be 0.

Raster Dataset
Data types for geoprocessing tool parameters


Command line example

IsNull_sa C:/data/ras_1 C:/data/final_1

Scripting syntax
About getting started with writing geoprocessing scripts
IsNull_sa (in_raster, out_raster)

Parameter Explanation Data Type
in_raster (Required)

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

Composite Geodataset
out_raster (Required)

The output raster. Where cell values in the input are NoData, the output value will be 1. If it is any other value, the output value will be 0.

Raster Dataset

Data types for geoprocessing tool parameters


Script example

# IsNull_sample.py
# Description: 
#   Returns 1 for cells in the input raster that have a value of 
#   NoData, and 0 if they do not.
# Requirements: None
# Requirements: None
# Author: ESRI
# Date: Sept 6, 2005
# Import system modules
import arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create()

try:
    # Set the input raster dataset
    inRaster1 = "c:/data/ras_1"

    # Set the output raster name
    outRaster = "c:/data/final_1"

    # Check out Spatial Analyst extension license
    gp.CheckOutExtension("Spatial")

    # Process: IsNull
    gp.IsNull_sa(inRaster1, outRaster)

except:
    # If an error occurred while running a tool, then print the messages.
    print gp.GetMessages()

Map Algebra syntax
IsNull(<grid>)

Parameter Explanation
<grid> An input integer or floating-point raster, or an expression resulting in a raster.

Map Algebra example

isnull(ingrid1)
isnull(-5.6 + ingrid1)
isnull(ingrid1 + ingrid2)
isnull(sin(ingrid1) * 4) + (focalsum(ingrid2))

ArcObjects syntax
ILogicalOp::IsNull (geoDataset As IGeoDataset) As IGeoDataset

Parameter Explanation
geoDataset An input Raster, RasterDataset, RasterBand, or RasterDescriptor.

ArcObjects example

' Create the RasterLogicalOp object
Dim pLogicalOp As ILogicalOp
Set pLogicalOp = New RasterMathOps

' Create the input raster object
Dim pInputDataset As IGeoDataset

' Calls function to open the input raster dataset from disk
Set pInputDataset = OpenRasterDataset("D:\SpatialData", "inputraster")

' Create the output dataset object
Dim pOutputDataset As IGeoDataset

' Calls the method
Set pOutputDataset = pLogicalOp.IsNull(pInputDataset)

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.