AnsweredAssumed Answered

Error Code 000964 after running arcpy.management.Clip

Question asked by jfritz on Oct 4, 2018
Latest reply on Oct 4, 2018 by BWhite-esristaff

In the following script an Error Code 000964 keeps coming up.  Any help on this would be great. 

 

import arcpy
arcpy.env.overwriteOutput = 1
arcpy.env.workspace = r"S:/General-Offices-GO-Trans/SLR-Mapping/GIS_Projects_2018/Smart_T_Line_Model/geodata/TEST_LINES.gdb/"
outbufferpath = r"S:/General-Offices-GO-Trans/SLR-Mapping/GIS_Projects_2018/Smart_T_Line_Model/geodata/TEST_BUFFER.gdb/"
outrasterpath = r"S:/General-Offices-GO-Trans/SLR-Mapping/GIS_Projects_2018/Smart_T_Line_Model/geodata/TEST_RASTERCLIP.gdb/"
outrastertopoint = r"S:/General-Offices-GO-Trans/SLR-Mapping/GIS_Projects_2018/Smart_T_Line_Model/geodata/TEST_RASTERTOPOINT.gdb/"
raster = r"S:/General-Offices-GO-Trans/SLR-Mapping/GIS_Projects_2018/Smart_T_Line_Model/geodata/STLM_NSP.gdb/MN_DEM3second"
featureClassList = arcpy.ListFeatureClasses()
arcpy.env.workspace = outbufferpath
featureClassList = arcpy.ListFeatureClasses()
for featureClass in featureClassList:
    for row in arcpy.da.SearchCursor(featureClass,'SHAPE@'):
        coords = ("row[0].extent.XMin&" "& row[0].extent.YMin&" "& row[0].extent.XMax&" "& row[0].extent.YMax")
        arcpy.management.Clip(raster, coords, outrasterpath + featureClass, featureClass, "255", "ClippingGeometry", "MAINTAIN_EXTENT")
Traceback (most recent call last):
  File "<string>", line 4, in <module>
  File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\management.py", line 15215, in Clip
    raise e
  File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\management.py", line 15212, in Clip
    retval = convertArcObjectToPythonObject(gp.Clip_management(*gp_fixargs((in_raster, rectangle, out_raster, in_template_dataset, nodata_value, clipping_geometry, maintain_clipping_extent), True)))
  File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\geoprocessing\_base.py", line 496, in <lambda>
    return lambda *args: val(*gp_fixargs(args, True))
arcgisscripting.ExecuteError: ERROR 000964: Specified extent is invalid
Failed to execute (Clip).

 

NOTE:  Line 8 was not intended.  Also, not sure an ampersand (&) needs to be placed after .YMAX

 

THANKS to anyone who can uncover the problem.

Outcomes