I was given a model my someone else, and am trying to decipher exactly what they are doing.

There is a step in the model which has the following expression:

SetNull("%Raster1%"<0,"%Raster 1%")

Is it taking all values of 0 and setting them to null?

What is happening in the second portion of the condition?


The Set Null tool takes the following parameters:

SetNull (in_conditional_raster, in_false_raster_or_constant, {where_clause})

which are described in the tool's documentation as follows:

  • in_conditional_raster: Input raster representing the true or false result of the desired condition. It can be of integer or floating point type.

  • in_false_raster_or_constant: 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.

  • {where_clause} (optional): A logical expression that determines which of the input cells are to be true or false. The expression follows the general form of an SQL expression. An example of a where_clause is "VALUE > 100".

What the statment is doing is setting to Null all the pixels that satisfy the "%Raster1%"<0 condition and leaving intact those pixels that do not satisfy the condition, which equals to the same raster, hence being the second parameter just the raster (i.e. "%Raster1%").

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.