3

In the following images, the first one has only 2 classes of pixels. I would like to remove Image's 1, class 1 (white pixels) completely from Image 2. As a result, Image 2 will have null values in the position of white pixels from Image 1. How can I do that using raster calculator on ArcGIS Pro?

Image 1: Values above 1 and bellow 0 of SMI_2021 raster enter image description here Image 2: Soil Moisture Index with valid range 0 to 1 enter image description here

3
  • 2
    Con(image1==0, image2)
    – FelixIP
    Jan 2 at 19:33
  • How can I use multiple statements inside con? For instance, looking at image 2 how can I replace all values bellow 0 and above 1 with null? @FelixIP
    – Chris
    Jan 2 at 20:18
  • 2
    Con(A>=0,1)×Con(A<=1,A)
    – FelixIP
    Jan 3 at 4:44

1 Answer 1

4

Subtract 1 from pixel values of raster 1 and muliply by -1: by this, you invert value: 1 results in 0, 0 results in 1. Then divide this with the pixel values of image 2. Division by 0 (for initial white pixels) should return null values.

1
  • 1
    B/(1 - A) is less convoluted, but still too much compared to conditional function.
    – FelixIP
    Jan 5 at 0:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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