odonnellm

Con and Python Map Algebra/Raster Calculator

Discussion created by odonnellm on Mar 2, 2011
I am having a difficult time implementing a con statement in python. I do not get an error, but the output is different from raster calculator (ArcGIS 10)

Raster Calc ex (this works):
Con("q_2.img" > "w_1.img",2, "m1a")

Python ex (this does not):
ConditionRas1 = "q_2.img"
ConditionRas2 = "w_1.img"
TrueRas = 2
FalseRas = "m1a"
myExpression = Con(ConditionRas1 > ConditionRas2, TrueRas, FalseRas)
myExpression.save(OutDS)

Thanks

Outcomes