Set Null (Spatial Analyst)

ArcGIS Pro 3.4 | | Help archive

Available with Spatial Analyst license.

Available with Image Analyst license.

Summary

Set Null sets identified cell locations to NoData based on a specified criteria. It returns NoData if a conditional evaluation is true, and returns the value specified by another raster if it is false.

Learn more about setting cell values to NoData with Set Null

Illustration

Set Null illustration
OutRas = SetNull(InRas1, InRas2, "Value = 4")

Usage

  • If the evaluation of the where clause is true, the cell location on the output raster will be assigned NoData. If the evaluation is false, the output raster will be defined by the input false raster or constant value.

  • If no where clause is specified, the output raster will have NoData wherever the conditional raster is not 0.

  • The input conditional raster does not affect whether the output data type is integer or floating point. If the input false raster (or constant value) contains floating-point values, the output raster will be floating point. If it contains all integer values, the output will be an integer raster.

  • If the Input conditional raster (in_conditional_raster in Python) is a single-band raster and the Input false raster or constant value (in_false_raster_or_constant In Python) raster is a constant, the output will be a single-band raster.

  • If both inputs are multiband rasters, the output will be a multiband raster. The output raster will also be multiband if the false raster input is a constant. The number of bands in each multiband input must be the same.

  • The tool will perform the operation on each band from the conditional raster using the corresponding band from the other input. If the conditional input is a multiband raster and the false raster input is a constant, the tool will perform the operation using the constant value for each band in the multiband input.

  • The Expression uses an SQL query. See the following topics for more details on creating queries:

  • In order to use a {where_clause} in Python, it should be enclosed in quotes. For example, "Value > 5000".

    You can consult the help for more information on specifying a query in Python.

  • The maximum length of the logical expression is 4,096 characters.

  • See Analysis environments and Spatial Analyst for additional details on the geoprocessing environments that apply to this tool.

Parameters

LabelExplanationData Type
Input conditional raster

The input raster representing the true or false result of the desired condition.

It can be of integer or floating point type.

Raster Layer
Input false raster or constant value

The input whose values will be used as the output cell values if the condition is false.

It can be an integer or a floating-point raster, or a constant value.

Raster Layer; Constant
Expression
(Optional)

A logical expression that determines which of the input cells are to be true or false.

The Where clause follows the general form of an SQL expression. It can be entered directly, for example, VALUE > 100, if you click the Edit SQL mode button SQL Query. If in the Edit Clause Mode Edit Clause, you can begin constructing the expression by clicking on the Add Clause Mode button.

SQL Expression

Return Value

LabelExplanationData Type
Output raster

The output raster.

If the conditional evaluation is true, NoData is returned. If false, the value of the second input raster is returned.

Raster

Licensing information

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

Related topics