AnsweredAssumed Answered

Store/execure v10.0 map algebra expression as a string

Question asked by csny490 on Jul 9, 2013
Latest reply on Jul 9, 2013 by csny490
I have some complexish map algebra expressions I am executing via a stand alone python script. An ugly example:

probGrd = arcpy.sa.Exp(-15.09665 + 0.31731 * arcpy.sa.Ln(accPGrd + 1) + -18.60898 * planF5Grd + -13.02439 * slpWgtGrd +  2.20068 * arcpy.sa.Ln(lenSwGrd + 1)) / (1 + arcpy.sa.Exp(-15.09665 + 0.31731 * arcpy.sa.Ln(accPGrd + 1) + -18.60898 * planF5Grd + -13.02439 * slpWgtGrd + 2.20068 * arcpy.sa.Ln(lenSwGrd + 1)))

I want to be able to store a number of such expressions as string variables - maybe in a list or dictionary, and then execute them in a loop. Is there some sort of method under arcpy.sa that is basically an ".executeStringExpression()" - in other words - a way to execute SOMA-like string expressions in arcpy.sa, or do I have to use the old gp.SOMA?

Outcomes