<?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 a GRID file (input raster) to a Shapefile (Clip Extent) in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/clipping-a-grid-file-input-raster-to-a-shapefile/m-p/348120#M27307</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;I am using ArcGIS 10.0 and am trying to clip GRID files to a shapefile boundary. I can do this easily in ArcMap using Data Management Tools &amp;gt; Raster &amp;gt; Raster Processing &amp;gt; Clip. However when it comes to python I get an error about my inFolder. Because GRID files don't have a .shp, .tif etc. at the end do I have to add something else to my script? Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;inFolder = "C:/Documents and Settings/someone/Desktop/Data/tmin_01"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;resultsFolder = "C:/Documents and Settings/someone/Desktop/Data/output"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;clipFeature = "C:/Documents and Settings/ajbaker/Desktop/PRISM_Trial/Boundary/Hydrographic_GB_boundary.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.Clip_management("inFolder", "#", "clipFeature","resultsFolder", "0", "ClippingGeometry")&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 May 2011 21:37:58 GMT</pubDate>
    <dc:creator>AdelaideBaker</dc:creator>
    <dc:date>2011-05-09T21:37:58Z</dc:date>
    <item>
      <title>Clipping a GRID file (input raster) to a Shapefile (Clip Extent)</title>
      <link>https://community.esri.com/t5/python-questions/clipping-a-grid-file-input-raster-to-a-shapefile/m-p/348120#M27307</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;I am using ArcGIS 10.0 and am trying to clip GRID files to a shapefile boundary. I can do this easily in ArcMap using Data Management Tools &amp;gt; Raster &amp;gt; Raster Processing &amp;gt; Clip. However when it comes to python I get an error about my inFolder. Because GRID files don't have a .shp, .tif etc. at the end do I have to add something else to my script? Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;inFolder = "C:/Documents and Settings/someone/Desktop/Data/tmin_01"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;resultsFolder = "C:/Documents and Settings/someone/Desktop/Data/output"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;clipFeature = "C:/Documents and Settings/ajbaker/Desktop/PRISM_Trial/Boundary/Hydrographic_GB_boundary.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.Clip_management("inFolder", "#", "clipFeature","resultsFolder", "0", "ClippingGeometry")&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 May 2011 21:37:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/clipping-a-grid-file-input-raster-to-a-shapefile/m-p/348120#M27307</guid>
      <dc:creator>AdelaideBaker</dc:creator>
      <dc:date>2011-05-09T21:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping a GRID file (input raster) to a Shapefile (Clip Extent)</title>
      <link>https://community.esri.com/t5/python-questions/clipping-a-grid-file-input-raster-to-a-shapefile/m-p/348121#M27308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;inFolder is a &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;variable&lt;/SPAN&gt;&lt;SPAN&gt; that contains a string, so you don't put it in quotes (the way it is now, it's literally looking for a file with the path "inFolder"). Same with the other &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;variables&lt;/SPAN&gt;&lt;SPAN&gt; you pass as parameters. If you were directly entering the string in the clip command, you would enclose it in quotes.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 May 2011 21:51:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/clipping-a-grid-file-input-raster-to-a-shapefile/m-p/348121#M27308</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2011-05-09T21:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping a GRID file (input raster) to a Shapefile (Clip Extent)</title>
      <link>https://community.esri.com/t5/python-questions/clipping-a-grid-file-input-raster-to-a-shapefile/m-p/348122#M27309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks. Problem solved!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2011 14:45:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/clipping-a-grid-file-input-raster-to-a-shapefile/m-p/348122#M27309</guid>
      <dc:creator>AdelaideBaker</dc:creator>
      <dc:date>2011-05-10T14:45:27Z</dc:date>
    </item>
    <item>
      <title>Clip Multiple GRID layers</title>
      <link>https://community.esri.com/t5/python-questions/clipping-a-grid-file-input-raster-to-a-shapefile/m-p/348123#M27310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am very new at all of this and have another problem. How do I clip multiple GRID files. Also how might I be able to overwrite the input file? Here is my script so far:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.overwriteOutput = True&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;inFolder = "C:/Documents and Settings/user/Desktop/Data/tmin_1900_01"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;resultsFolder = "C:/Documents and Settings/user/Desktop/Data/tmin_1900_01"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;clipFeature = "S:/Projects/Wetlands/Title/Maps/Data layers/GB_boundary.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.workspace = resultsFolder&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#Process: Clip...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for input_feature in inFolder:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for clip_feature in clipFeature:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outfile = arcpy.CreateUniqueName(resultsFolder, inFolder)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#Usage: Clip_management in_raster rectangle out_raster {in_template_dataset} {nodata_value} {NONE | ClippingGeometry}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.Clip_management(inFolder, "#", outfile, clipFeature, "0", "ClippingGeometry")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;print "Clip_management worked!"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;print arcpy.GetMessages()&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2011 19:47:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/clipping-a-grid-file-input-raster-to-a-shapefile/m-p/348123#M27310</guid>
      <dc:creator>AdelaideBaker</dc:creator>
      <dc:date>2011-05-12T19:47:31Z</dc:date>
    </item>
  </channel>
</rss>

