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))"/>
Get bug updates in the app
URL copiedShare URL
Bug
The prescribed Python syntax for complex conditional expressions does not work outside of the Raster Calculator.
Last Published: February 17, 2017ArcGIS for Desktop
Bug ID Number
BUG-000087994
Submitted
June 1, 2015
Last Modified
June 11, 2020
Applies to
ArcGIS for Desktop
Version found
10
Operating System
Windows
Operating System Version
7 64 Bit
Status
Known Limit
After review by the development team, it has been determined that this issue is related to a known limitation with the software that lies outside of Esri's control. The issue's Additional Information section may contain further explanation.
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))