I have two grids, grid A representing observed extents of flooding and grid B representing simulated extents from a hydraulic model. The rasters have the same extent and grid size.
I want to be able to compare each pixel and create a new raster with 4 unique values (A/B/C/D equivalent in the table below) to show the difference between the two rasters:
If this was a shapefile field calculator problem I'd use a CASE logic like the one below but I'm struggling to identify a QGIS raster-based equivalent. Can anyone suggest anything I could try?
CASE
WHEN "Modelled" > 0 AND "Observed" > 0 THEN D
WHEN "Modelled" = 0 AND "Observed" > 0 THEN C
WHEN "Modelled" > 0 AND "Observed" = 0 THEN B
WHEN "Modelled" = 0 AND "Observed" = 0 THEN A
END
AND
isn't used. Try something like:ifelse(gt(a,0)+gt(b,0),400,ifelse(eq(a,0)+gt(b,0),300,ifelse(gt(a,0)+eq(b,0),200,ifelse(eq(a,0)+eq(b,0),100,0))))