gshdet

Help with Map Algebra - Con

Discussion created by gshdet on Jul 4, 2012
Latest reply on Jul 6, 2012 by philmorefield
Hello,

I have the below code which crashes arcmap on the con statement line.

Please can somebody help with a workaround so it will not crash.

Thank you very much.

James

import arcpy, os
from arcpy import env
from arcpy.sa import *

arcpy.env.extent = "c:\\SS\\Rasters\\N4870_E625_web.tif"
arcpy.env.cellSize = "c:\\SS\\Rasters\\N4870_E625_web.tif"

OutRas = Con(("c:\\SS\\Rasters\\N4870_E625_web.tif\\Band_1"> 0) | ("c:\\SS\\Rasters\\N4870_E625_web.tif\\Band_2" > 0) | ("c:\\SS\\Rasters\\N4870_E625_web.tif\\Band_3" > 0), 1,0)
OutRas.save("C:\\SS\\Rasters\\Calc\\Test_FC.tif")

Outcomes