Advanced Con Statement in Raster Calculations

Discussion created by suppan on Jan 16, 2012
Latest reply on Jan 18, 2012 by philmorefield
Hi there,

i am trying to convert Python Code from 9.2 to 10.x
The problem i am facing: in ArcGIS 9.2 it was possible, to create a Map Algebra Expression with a variable number of input rasters by defining it as a string Variable.

In ArcGis 10 it is not anymore possible to use String Variables in a Raster Expression for building complex statements in a Con command.

So if i have an input list with 4 values, i want to create the expression like this,
(Raster(inRaster1) < var1[0]) & (Raster(inRaster2) > var1[1]) & (Raster(inRaster3) <> var1[2]) & (Raster(inRaster4) == var1[3]) ,

if i have only 2 input rasterfiles, only the first part of inRaster1 and inRaster2 should be used, if i have 16 or more files it should also work.

A conversion from String to Raster would be maybe the best solution, but the Con Command doesn't accept this.

Any suggestions, how to deal in ArcGis 10 with a variable number of input rasters?
With best regards