0.1". >>> Con(("Random1.tif" > 0.1),"Random1.tif",Con(("Random2.tif">0.1),"Random2.tif",0.1)) In stead, defining a raster object first for this layer, then the complex expression should work. >>> rasob = arcpy.sa.Raster("Random1.tif") >>> outras = Con((rasob > 0.1),"Random1.tif",Con((rasob> 0.1),"Random2.tif",0.1))"/>
laptop and a wrench

Bug

The prescribed Python syntax for complex conditional expressions does not work outside of the Raster Calculator.

Last Published: February 17, 2017 ArcGIS for Desktop
Bug ID Number BUG-000087994
SubmittedJune 1, 2015
Last ModifiedJune 11, 2020
SeverityMedium
Applies toArcGIS for Desktop
Version found10
Operating SystemWindows
Operating System Version7 64 Bit
StatusKnown Limit

Additional Information

The expression below won''t work in python, because map algebra take raster object as input, while "Random1.tif" would be treated as string but not raster in the expression ""Random1.tif">0.1". >>> Con(("Random1.tif" > 0.1),"Random1.tif",Con(("Random2.tif">0.1),"Random2.tif",0.1)) In stead, defining a raster object first for this layer, then the complex expression should work. >>> rasob = arcpy.sa.Raster("Random1.tif") >>> outras = Con((rasob > 0.1),"Random1.tif",Con((rasob> 0.1),"Random2.tif",0.1))

Workaround

Using the syntax containing the <where_clause> parameter from the following help resources, it is still possible to create complex Conditional expressions. 10.0: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z00000008000000.htm. 10.2: http://resources.arcgis.com/en/help/main/10.2/index.html#//009z00000008000000. 10.3: http://desktop.arcgis.com/en/desktop/latest/tools/spatial-analyst-toolbox/conditional-evaluation-with-con.htm.

Steps to Reproduce

Bug ID: BUG-000087994

Software:

  • ArcGIS for Desktop

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic