<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic clipping multiple rasters to single polygon in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/clipping-multiple-rasters-to-single-polygon/m-p/751658#M24616</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I have 44 individual polygons and then 50 raster datasets, and I would like to clip the single polygon to the 50 rasters and get 50 individual rasters in the extent of the polygon. I have been using the batch process but I would love to figure out how to automate the process better. I've tried modelbuilder; using the clip tool in conjunction with iterate rasters, but I only get one output, its my first time using iterate rasters in modelbuilder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any feedback will be much appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Feb 2013 20:17:50 GMT</pubDate>
    <dc:creator>ThomasHutchens</dc:creator>
    <dc:date>2013-02-28T20:17:50Z</dc:date>
    <item>
      <title>clipping multiple rasters to single polygon</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/clipping-multiple-rasters-to-single-polygon/m-p/751658#M24616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I have 44 individual polygons and then 50 raster datasets, and I would like to clip the single polygon to the 50 rasters and get 50 individual rasters in the extent of the polygon. I have been using the batch process but I would love to figure out how to automate the process better. I've tried modelbuilder; using the clip tool in conjunction with iterate rasters, but I only get one output, its my first time using iterate rasters in modelbuilder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any feedback will be much appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2013 20:17:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/clipping-multiple-rasters-to-single-polygon/m-p/751658#M24616</guid>
      <dc:creator>ThomasHutchens</dc:creator>
      <dc:date>2013-02-28T20:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: clipping multiple rasters to single polygon</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/clipping-multiple-rasters-to-single-polygon/m-p/751659#M24617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think this would be easy in Python.&amp;nbsp; If all of your rasters are in the same folder you could just use the ListRasters to iterate through them all.&amp;nbsp; If not, you could use a wildcard and the os.walk or arcpy.da walk (for Arc 10.1) to loop thru folders.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy, os

arcpy.env.workspace = r'G:\WIU\Geog408\deng_lab4\Thermal_south_results\May\deg_170'
arcpy.env.overwriteOutput = True

# Clip region
poly = r'C:\testing\TestData\clipReg.shp'
out_folder = r'C:\testing\TestData\outputs'

for raster in arcpy.ListRasters():
&amp;nbsp;&amp;nbsp;&amp;nbsp; out_raster = os.path.join(out_folder,raster)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Clip_management(raster,'#',out_raster,poly,'#','ClippingGeometry')
&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'Clipped: %s' %raster
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:54:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/clipping-multiple-rasters-to-single-polygon/m-p/751659#M24617</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T07:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: clipping multiple rasters to single polygon</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/clipping-multiple-rasters-to-single-polygon/m-p/751660#M24618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;well I'm not too experienced with python but I will give this a try, thanks so much for responding.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 16:27:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/clipping-multiple-rasters-to-single-polygon/m-p/751660#M24618</guid>
      <dc:creator>ThomasHutchens</dc:creator>
      <dc:date>2013-03-01T16:27:55Z</dc:date>
    </item>
  </channel>
</rss>

