huffmanp

Just trying to do some map algebra, but get extent and cellsize errors.

Discussion created by huffmanp on Nov 1, 2011
Latest reply on Nov 2, 2011 by huffmanp
I wanted to generate a few flow accumulation grids for alternative pour point inputs.  The docs more map algebra made it seem like it would be simple to do this in the python window.  But I can't get my env set up correctly.  Why isn't easy like: http://forums.arcgis.com/threads/32283-set-extent

I've been trying stuff like:

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "c:/avdata/topsim/utm/accumtest"
env.cellSize = 10
# env.extent = "c:/avdata/topsim/utm/accumtest/accum"
mxd = arcpy.mapping.MapDocument("CURRENT")
env.cellSize = 10
df = arcpy.mapping.ListDataFrames(mxd,mxd.activeView)
env.extent = df[0].extent
accum9M = Con("accum">9000000,1)

but when the line setting the extent to an existing file env.extent = "c:/avdata/topsim/utm/accumtest/accum" was followed by the map algebra line, ArcMap 10, sp3, crashed hard to the "ArcMap has encountered a serious problem" reporting window.  So I tried to set it to the extent of the current dataframe, lines 7,9,10. But only get a "No CellSize and Extent set" run time error.  But when I try to print out the extent, it looks valid, and the cellSize seems to be set to MAXOF.

Outcomes