Select to view content in your preferred language

Performing if else condition on two raster layers

6805
21
Jump to solution
08-26-2014 10:57 AM
LawrenceSekaluvu
Emerging Contributor

Hi,

I am working on a project and i am writing my scripts in python. However, i am experiencing an obstacle that might make me quit this project for good. Here is is the problem. I want to perform a if else condition on two raster layers that have constant values across all there grid. Initially, i create two raster layers, each with a constant value within each cell. However, when i perform a loop on these two raster layers, one of them at the end will have cells with different values and i need to loop in again to compare it with the other raster with a constant value. I tried using the "Con" tool but things have not worked at all.  Any clues please?

0 Kudos
21 Replies
SteveLynch
Esri Regular Contributor

If I understand the problem correctly I would do the following:

  • Multiply each raster by say 1000 (or whatever you decide on) because COMBINE will INT the values
  • Use COMBINE

Have a look at the COMBINE tool and decide if this will do the job.

-Steve

LawrenceSekaluvu
Emerging Contributor

Steve Lynch‌, thanks for hinting out this tool. i didn't know about it!! Unfortunately, it could do my job as i wanted. I will use it when generating for  table of stream orders, flow accumulation and analysis of other four parameters that I am looking at. Thanks a lot!!

0 Kudos