Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Clipping a raster and renaming it

$
0
0
I am still pretty much a beginner when it comes to python, so go easy on me. I am trying to clip a raster to a tiled polygon layout. I have a feeling that my errors: ERROR 000628: Cannot set input into parameter rectangle. and Error 000622 are happening when I am trying to use the geometry of one feature to clip my raster, and then renaming it to that tile name in the "text" field.

Any help would be much appreciated, and please let me know if anything needs to be clarified.

Thanks!!

Code:

desc = arcpy.Describe(DEMpoly)
shapefieldname = desc.shapeFieldName

rowCursor = arcpy.SearchCursor(DEMpoly)

for row in rowCursor:
    feat = row.getValue(shapefieldname)
    arcpy.Clip_management(OUTraster, feat, row.getValue(Text) + ".img")
    cursor.next()


Viewing all articles
Browse latest Browse all 2485

Trending Articles