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 patharcpy.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 + "/" + fgdbarcpy.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?
Changed the line:
outName = os.path.join(fgdbPath,"minpnt01")
to:
outName02 = os.path.join(dirName,"minpnt01.tif")
seems to run now...