<?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 Re: Clipping a raster and renaming it in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/clipping-a-raster-and-renaming-it/m-p/633890#M49373</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Since you're new to Python, I thought I'd show you how formatting strings help with the syntax.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Much easier to debug when a SQL expression or pathname gets complicated!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
for row in rowCursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; feat = row.getValue(shapefieldname)
&amp;nbsp;&amp;nbsp;&amp;nbsp; clipRas = "{0}.img".format(row.getValue(field))
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Clip_management(OUTraster, "#", clipRas, feat, "0", "ClippingGeometry")
&amp;nbsp;&amp;nbsp;&amp;nbsp; rowCursor.next()
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 02:58:12 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2021-12-12T02:58:12Z</dc:date>
    <item>
      <title>Clipping a raster and renaming it</title>
      <link>https://community.esri.com/t5/python-questions/clipping-a-raster-and-renaming-it/m-p/633888#M49371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am still pretty much a beginner when it comes to python, so go easy on me.&amp;nbsp; 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&amp;nbsp; 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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be much appreciated, and please let me know if anything needs to be clarified.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;desc = arcpy.Describe(DEMpoly) shapefieldname = desc.shapeFieldName&amp;nbsp; rowCursor = arcpy.SearchCursor(DEMpoly)&amp;nbsp; for row in rowCursor: &amp;nbsp;&amp;nbsp;&amp;nbsp; feat = row.getValue(shapefieldname) &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Clip_management(OUTraster, feat, row.getValue(Text) + ".img") &amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.next()&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2013 21:36:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/clipping-a-raster-and-renaming-it/m-p/633888#M49371</guid>
      <dc:creator>RileyCotter</dc:creator>
      <dc:date>2013-04-01T21:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping a raster and renaming it</title>
      <link>https://community.esri.com/t5/python-questions/clipping-a-raster-and-renaming-it/m-p/633889#M49372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;fixed it.....just had my input and output values for the clip tool all messed up&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;for row in rowCursor: &amp;nbsp;&amp;nbsp;&amp;nbsp; feat = row.getValue(shapefieldname) &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Clip_management(OUTraster, "#", row.getValue(field) + ".img", feat, "0", "ClippingGeometry") &amp;nbsp;&amp;nbsp;&amp;nbsp; rowCursor.next()&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2013 22:19:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/clipping-a-raster-and-renaming-it/m-p/633889#M49372</guid>
      <dc:creator>RileyCotter</dc:creator>
      <dc:date>2013-04-01T22:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping a raster and renaming it</title>
      <link>https://community.esri.com/t5/python-questions/clipping-a-raster-and-renaming-it/m-p/633890#M49373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Since you're new to Python, I thought I'd show you how formatting strings help with the syntax.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Much easier to debug when a SQL expression or pathname gets complicated!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
for row in rowCursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; feat = row.getValue(shapefieldname)
&amp;nbsp;&amp;nbsp;&amp;nbsp; clipRas = "{0}.img".format(row.getValue(field))
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Clip_management(OUTraster, "#", clipRas, feat, "0", "ClippingGeometry")
&amp;nbsp;&amp;nbsp;&amp;nbsp; rowCursor.next()
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:58:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/clipping-a-raster-and-renaming-it/m-p/633890#M49373</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-12T02:58:12Z</dc:date>
    </item>
  </channel>
</rss>

