1

I have two rasters that I wish to combine to give a third raster that describes spatially where multiple conditions of both rasters are met. For example, say my two input rasters are raster A and raster B. Values like this:

RASTER A:

   X1 X2 X3
Y1 A1 A2 A2
Y2 A1 A1 A1
Y3 A1 A1 A2

RASTER B:

   X1 X2 X3
Y1 B1 B1 B1
Y2 B1 B1 B1
Y3 B1 B1 B1

I want to create a third raster with different values that occur where conditions from both are met, see the below "psuedo-code" describing what I want:

WHERE (RASTERA = A1 AND RASTERB = B1) THEN ALPHA WHERE (RASTERA = A2 AND RASTERB = B1) THEN BETA

Giving my final raster as below:

   X1    X2    X3
Y1 ALPHA BETA  BETA
Y2 ALPHA ALPHA ALPHA
Y3 ALPHA ALPHA BETA

How can I accomplish this, preferably using raster calculator?

P.S. In my real data, I have numbers that I need to be in certain ranges. As such I could not simply concatenate the raster values (e.g. A1, and B1 to give A1B1) and give an alias fitting to that.

2

You can use the conditional tool where you can use

Con(((Raster1=a1) &(Raster2=b1)),alpha,Con(((Raster1=a2)&(Raster2=b2)),beta,delta))

the cells that are assigned 'delta' will be the ones that do not fulfill both conditions given above.

0

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.