Hello,
I'm trying to use Clip_management to clip 8 rasters to about 200 different polygon boundaries. I've got it in a python loop, but am stymied by the 'rectangle' part of the syntax for that tool. I can't hard-code that info as it changes for each polygon, I'm assuming.
Can I specify a rectangle extent that encompasses all of the polygons (generally in the state of Colorado)?
Thank you!
It is easier for fellow GeoNet community members to provide feedback if you post relevant, functional parts of your code.
This thread shows how you can loop through polygons and extract the raster by mask: Re: Zonal statistics - percentiles .
When you loop through the polygons, each polygon has a extent property. This can be used in the Clip Management tool like this:
ext = polygon.extent rect = "{0} {1} {2} {3}".format(ext.XMin, ext.YMin, ext.XMax, ext.YMax)
... and yes I would be a lot better if you would post the code.