I have the following script that reclassifies rasters and then combines them into one. I am trying to clip the final raster to a shapefile I have. All my research shows that I need to clip it to the extents of the shapefile (called a rectangle). My script is as follows;

import arcpy
from arcpy import env  
from arcpy.sa import *

env.workspace = "C:\\Data"


outReclass1 = Reclassify("stream", "VALUE",
                     RemapValue([[1,0], ["NoData",1]]))

outReclass2 = Reclassify("pond", "VALUE",
                     RemapValue([[1,0], ["NoData",1]]))

outReclass3 = Reclassify("landuse", "VALUE",
                     RemapValue([[1,1], [2,2], [3,3], [4,4]]))

outReclass4 = Reclassify("soils", "VALUE",
                     RemapValue([[1,3,1], [3,6,2], [6,9,3], [9,12,4], [12,15,5]]))

finalRaster = outReclass1 * outReclass2 * outReclass3 * outReclass4


arcpy.Clip_management("riskarea", "440677.437, 4331200, 611070.062, 611070.062", "riskarea_clipped")

I am getting the following error;

line 30, in <module>
    arcpy.Clip_management("riskarea", "440677.437, 4331200, 611070.062, 611070.062", "riskarea_clipped")
  File "C:\Program Files (x86)\ArcGIS\Desktop10.6\ArcPy\arcpy\management.py", line 15884, in Clip
raise e
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000732: Rectangle: Dataset 440677.437, 4331200, 611070.062, 611070.062 does not exist or is not supported
ERROR 000472: Name of single band grid cannot have more than 13 characters
Failed to execute (Clip).
  • 1
    Do you really mean to be using Grid format?? GeoTIFF is there for the asking by adding a ".tif" suffix. Then you won't be constrained by the 16 character INFO name limitation that requires base names to not exceed 13 characters.
    – Vince
    Oct 27 '18 at 4:02

Your X-Maximum, Y-Maximum values are the same so you are not providing a valid rectangle. Recheck the bounding extent of your area and try again. http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/clip.htm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy