AnsweredAssumed Answered

CON causes crash

Question asked by JohnWallX on Nov 1, 2016
Latest reply on Nov 2, 2016 by JohnWallX

I have the following code:

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

arcpy.env.workspace = "C:/gis/enforcer" #Dummy path

arcpy.env.overwriteOutput = True

dem = "C:/gis/enforcer/dem" #Dummy path
rmseDEM = 0.09 #Dummy value
roads = "C:/gis/enforcer/roads.shp" #Dummy path
rails = "C:/gis/enforcer/rail.shp" #Dummy path
fgdb = "enforcer.gdb" #Dummy path

arcpy.env.cellSize = dem
arcpy.env.extent = dem
arcpy.env.sanpRaster = dem
desc = arcpy.Describe(dem)
demResolution = desc.meanCellHeight #Assumes a square
dirName = os.path.dirname(dem)
fgdbPath = dirName + "/" + fgdb

arcpy.CheckOutExtension("Spatial")

#-----------------------------------Identify Low Points----------------------------------
analysisSinks = fgdbPath + "/" + "sinkanalysis"
outName = fgdbPath + "/" + "zonemin01"
outZonalStats = ZonalStatistics(analysisSinks, "OBJECTID", dem, "MINIMUM", "NODATA")
outZonalStats.save(outName)
outName02 = "minpnt01" #fgdbPath + "/"
outCon = Con(dem == outName, 1)
outCon.save(outName02)

However, Con in the next to last line seems to crash PythonWin every chance it gets or throws ERROR 010240. I've tried everything from saving it as a TIF to switching to a different directory to no avail. Any recommendations?

Outcomes