I'm trying to combine 2 raster layers using gdal_calc in order to use them in QGIS 3.8.
One of the condition that has to be met could be translated as "if the value of raster A is 1 and the value of raster B is either 10 or 11 or... or 800 (I've got 20 different values or so), then keep the value of raster B".
I managed to achieve what I wanted using several logical_and :
logical_and(A==1,B==10)*B + logical_and(A==1,B==11)*B + ... + logical_and(A==1,B==800)*B
But it's tedious to write and hard to read for other users. Is there a way to get the same result using a more compact syntax ? I tried using
logical_and(A==1,any(B==[1,10,11,12,33,35,41,42,43,44,51,52,53,222,223,224,602,700,702,710,800]))*B
and logical_and(A==1,B==any([1,10,11,12,33,35,41,42,43,44,51,52,53,222,223,224,602,700,702,710,800]))*B
But neither of these gave me the same result as my previous lengthy expression...