error with extract by mask

1075
2
10-29-2013 11:26 AM
katiemerriman
New Contributor
Hi I am trying to batch extract by mask several watersheds from a single DEM. I know my DEM exists, however, I keep receiving the following error:
Traceback (most recent call last):
File "Z:/Sediment/extractbymask_edits.py", line 61, in <module>
subbasinDEM = arcpy.gp.ExtractByMask(arc3_feet, subbasin)
File "C:\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing\_base.py", line 474, in <lambda>
return lambda *args: val(*gp_fixargs(args))
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000860: Input raster: is not the type of Composite Geodataset, or does not exist.
Failed to execute (ExtractByMask).

I'm not sure what I am doing wrong here. Is it because I am accessing the DEM from a network server?
thanks. My code below.

# Create the Geoprocessor object
import sys, os, string
# Import arcpy module
import arcpy
from arcpy import env

# Check out any necessary licenses
arcpy.CheckOutExtension("Spatial")

dirpath = "Z:\\Sediment\\"
env.workspace = dirpath + "\\DrainageAReas.gdb" #can set as argumment
outpath = dirpath + "New File Geodatabase.gdb"

#Raster paths:
arc3_feet = "\\\\Sediment\\all_1-3arc"

# start loop of subbasin feature classes
fcList = arcpy.ListFeatureClasses() # return all features in workspace
for subbasin in fcList:
outfile = outpath + subbasin + "DEM"

# Extract by mask
subbasinDEM = arcpy.gp.ExtractByMask(arc3_feet, subbasin, outfile)
Tags (2)
0 Kudos
2 Replies
JakeSkinner
Esri Esteemed Contributor
Try converting your DEM from an ESRI GRID to another format, such as a .TIF, using the Copy Raster tool.  Also, for rasters, feature classes, shapefiles, etc you should not:

1.  Have any special characters in the name
2.  Have any spaces in the name
3.  Begin the name with a number
katiemerriman
New Contributor
thanks! just removing the special characters from the name of the DEM fixed it!!
0 Kudos