# Con function

## Overview

Sets the pixels of the output raster based on an if\else evaluation of each input pixel. It returns pixel values from the True Raster if the conditional evaluation is true (1) or returns the pixel values from the False Raster if the conditional evaluation is false (0). This criteria is specified by the output of a logical math function, which will be the input Raster.

The Con function must be proceeded by a Math: Logical function, such as the Greater Than function. The output from the logical function is a Boolean raster (values of 1 and 0). When using the Con function, all values of 1 will be set to the True Raster and all values of 0 will be set to the False Raster values. ## Notes

If either the True Raster or the False Raster is a floating point, the output raster will be a floating point. If both the True Raster and the False Raster are integer, the output will be integer.

If no True Raster or constant is specified, NoData will be assigned to those cells that do not result in the true expression.

If there are any NoData pixels in the inputs, it remains NoData in the output.

If the Raster is a single band raster and either the True Raster or the optional False Raster is a constant, the output will be a single band raster.

If all inputs are multiband rasters, the output will be a multiband raster. The output raster will also be multiband if either the true input or the optional false input is a constant. The number of bands in each multiband input must be the same.

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

## Parameters

Parameter nameDescription

Raster

The input raster that represents the Boolean result of a logical math raster function. The values will be either 1 (for true) or 0 (for false). It can be an integer or a floating-point raster.

True Raster

The input whose values will be used as the output pixel values if the condition is true. It can be an integer, a floating-point raster, or a constant value.

False Raster

The input whose values will be used as the output pixel values if the condition is false. It can be an integer, a floating-point raster, or a constant value.

Extent Type

Choose which extent should be used in the output raster:

• First Of—Use the extent of the first input raster to determine the processing extent.

• Intersection Of—Use the extent of the overlapping pixels to determine the processing extent. This is the default.
• Union Of—Use the extent of all the rasters to determine the processing extent.
• Last Of—Use the extent of the last input raster to determine the processing extent.

Cellsize Type

Choose which cell size to use in the output raster. If all the input cell sizes are the same, all the options will yield the same results.

• First Of—Use the first cell size of the input rasters.
• Min Of—Use the smallest cell size of all the input rasters.
• Max Of—Use the largest cell size of all the input rasters. This is the default.
• Mean Of—Use the mean cell size of all the input rasters.
• Last Of—Use the last cell size of the input rasters.
{"ft_lang_label":"__label__en","ft_lang_prob":0.7010976,"math_prob":0.98406726,"size":2710,"snap":"2022-40-2023-06","text_gpt3_token_len":586,"char_repetition_ratio":0.18551368,"word_repetition_ratio":0.11618257,"special_character_ratio":0.20405903,"punctuation_ratio":0.08239701,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98617554,"pos_list":[0,1,2],"im_url_duplicate_count":[null,3,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-02-03T13:08:20Z\",\"WARC-Record-ID\":\"<urn:uuid:9d4bdcfc-89ae-4c87-9c61-5e4c8370a6c1>\",\"Content-Length\":\"19477\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:b907c779-dbe8-4bad-ad6e-d63412b8cdaf>\",\"WARC-Concurrent-To\":\"<urn:uuid:891afacf-2b6f-434f-9cb4-d51b1e5179f3>\",\"WARC-IP-Address\":\"198.102.60.60\",\"WARC-Target-URI\":\"https://pro.arcgis.com/en/pro-app/latest/help/analysis/raster-functions/con-function.htm\",\"WARC-Payload-Digest\":\"sha1:L3C3GJUPDPN2HILSSFQMCSIH4GRW3NEX\",\"WARC-Block-Digest\":\"sha1:OOFZ23M7NIMANYCBT3VL2Y53SZH7V5DG\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-06/CC-MAIN-2023-06_segments_1674764500056.55_warc_CC-MAIN-20230203122526-20230203152526-00357.warc.gz\"}"}