<?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 Python Object Error on Zonal Statistics For Loop in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-object-error-on-zonal-statistics-for-loop/m-p/600043#M46894</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #242729; background-color: rgba(248, 248, 248, 0.6);"&gt;I have a feature class containing multiple buffers. I would like to iterate over those buffers and perform&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #242729; background-color: rgba(248, 248, 248, 0.6); border: 0px; font-weight: bold;"&gt;&lt;STRONG&gt;Zonal Statistics&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #242729; background-color: rgba(248, 248, 248, 0.6);"&gt; identifying the minimum. But, I keep getting an &lt;/SPAN&gt;&lt;SPAN style="color: #242729; background-color: rgba(248, 248, 248, 0.6); border: 0px;"&gt;&lt;EM&gt;RuntimeError: Object: Error&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #242729; background-color: rgba(248, 248, 248, 0.6);"&gt; in executing tool and I can't for the life of me figure out what I'm doing wrong.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;#Inputs &amp;amp; Outputs&lt;BR /&gt;useMultiBuffs = "C:/gis/data/xy/hydropath.gdb/useErased"&lt;BR /&gt;gdbName = "scratch.gdb"&lt;BR /&gt;filepath = "C:/gis/data/xy"&lt;BR /&gt;DEM = "C:/gis/data/raster/dem1m"&lt;BR /&gt;allMinPnts = "C:/gis/data/scratch.gdb/allminpnts"&lt;BR /&gt;buffIntersects = "C:/gis/data/xy/hydropath.gdb/buffIntersect15m"&lt;/P&gt;&lt;P&gt;#Workspace, Extensions &amp;amp; Environment Variables&lt;BR /&gt;arcpy.CheckOutExtension("Spatial") #Checkout Spatial Extention&lt;/P&gt;&lt;P&gt;arcpy.CreateFileGDB_management(filepath,gdbName)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;field = "OBJECTID_1"&lt;BR /&gt;callField = '"%s"' % field&lt;BR /&gt;cursor = arcpy.SearchCursor(useMultiBuffs)&lt;BR /&gt;row = cursor.next()&lt;BR /&gt;while row:&lt;BR /&gt; outZonalStats = ZonalStatistics(row, callField, DEM, "MINIMUM", "NODATA")&lt;BR /&gt; buildOutName = filepath + "/" + gdbName + "/" + "z" + row.getValue(field) + "r"&lt;BR /&gt; outZonalStats.save(buildOutName)&lt;BR /&gt; row = cursor.next()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;print "DONE!"&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Sep 2016 18:33:48 GMT</pubDate>
    <dc:creator>JohnWall</dc:creator>
    <dc:date>2016-09-01T18:33:48Z</dc:date>
    <item>
      <title>Python Object Error on Zonal Statistics For Loop</title>
      <link>https://community.esri.com/t5/python-questions/python-object-error-on-zonal-statistics-for-loop/m-p/600043#M46894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #242729; background-color: rgba(248, 248, 248, 0.6);"&gt;I have a feature class containing multiple buffers. I would like to iterate over those buffers and perform&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #242729; background-color: rgba(248, 248, 248, 0.6); border: 0px; font-weight: bold;"&gt;&lt;STRONG&gt;Zonal Statistics&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #242729; background-color: rgba(248, 248, 248, 0.6);"&gt; identifying the minimum. But, I keep getting an &lt;/SPAN&gt;&lt;SPAN style="color: #242729; background-color: rgba(248, 248, 248, 0.6); border: 0px;"&gt;&lt;EM&gt;RuntimeError: Object: Error&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #242729; background-color: rgba(248, 248, 248, 0.6);"&gt; in executing tool and I can't for the life of me figure out what I'm doing wrong.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;#Inputs &amp;amp; Outputs&lt;BR /&gt;useMultiBuffs = "C:/gis/data/xy/hydropath.gdb/useErased"&lt;BR /&gt;gdbName = "scratch.gdb"&lt;BR /&gt;filepath = "C:/gis/data/xy"&lt;BR /&gt;DEM = "C:/gis/data/raster/dem1m"&lt;BR /&gt;allMinPnts = "C:/gis/data/scratch.gdb/allminpnts"&lt;BR /&gt;buffIntersects = "C:/gis/data/xy/hydropath.gdb/buffIntersect15m"&lt;/P&gt;&lt;P&gt;#Workspace, Extensions &amp;amp; Environment Variables&lt;BR /&gt;arcpy.CheckOutExtension("Spatial") #Checkout Spatial Extention&lt;/P&gt;&lt;P&gt;arcpy.CreateFileGDB_management(filepath,gdbName)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;field = "OBJECTID_1"&lt;BR /&gt;callField = '"%s"' % field&lt;BR /&gt;cursor = arcpy.SearchCursor(useMultiBuffs)&lt;BR /&gt;row = cursor.next()&lt;BR /&gt;while row:&lt;BR /&gt; outZonalStats = ZonalStatistics(row, callField, DEM, "MINIMUM", "NODATA")&lt;BR /&gt; buildOutName = filepath + "/" + gdbName + "/" + "z" + row.getValue(field) + "r"&lt;BR /&gt; outZonalStats.save(buildOutName)&lt;BR /&gt; row = cursor.next()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;print "DONE!"&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2016 18:33:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-object-error-on-zonal-statistics-for-loop/m-p/600043#M46894</guid>
      <dc:creator>JohnWall</dc:creator>
      <dc:date>2016-09-01T18:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: Python Object Error on Zonal Statistics For Loop</title>
      <link>https://community.esri.com/t5/python-questions/python-object-error-on-zonal-statistics-for-loop/m-p/600044#M46895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know it's probably a quirk in the interface, but can you please format your code block into multiple rows?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2016 18:35:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-object-error-on-zonal-statistics-for-loop/m-p/600044#M46895</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2016-09-01T18:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: Python Object Error on Zonal Statistics For Loop</title>
      <link>https://community.esri.com/t5/python-questions/python-object-error-on-zonal-statistics-for-loop/m-p/600045#M46896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh gosh, how embarrassing! Thanks for telling me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2016 18:44:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-object-error-on-zonal-statistics-for-loop/m-p/600045#M46896</guid>
      <dc:creator>JohnWall</dc:creator>
      <dc:date>2016-09-01T18:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: Python Object Error on Zonal Statistics For Loop</title>
      <link>https://community.esri.com/t5/python-questions/python-object-error-on-zonal-statistics-for-loop/m-p/600046#M46897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think what's happening is that you're trying to jam a &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/row.htm"&gt;row object&lt;/A&gt; where a feature layer should be (first parameter of &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/spatial-analyst-toolbox/zonal-statistics.htm"&gt;ZonalStatistics&lt;/A&gt;). I'm not quite sure how to convert a row object to a layer&amp;nbsp;with the old-style cursors, but it is definitely possible...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2016 19:12:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-object-error-on-zonal-statistics-for-loop/m-p/600046#M46897</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2016-09-01T19:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Python Object Error on Zonal Statistics For Loop</title>
      <link>https://community.esri.com/t5/python-questions/python-object-error-on-zonal-statistics-for-loop/m-p/600047#M46898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Darren,&lt;/P&gt;&lt;P&gt;Thanks for letting me know. I guess I'd have to use the row object to Select Layer by Attribute then pass that to Zonal Statistics? I keep thinking there used to be a faster way, but I cannot remember what it was and I haven't been able to locate any other method online in my searches. If you have any recommendations they would be much appreciated.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2016 14:33:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-object-error-on-zonal-statistics-for-loop/m-p/600047#M46898</guid>
      <dc:creator>JohnWall</dc:creator>
      <dc:date>2016-09-02T14:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Python Object Error on Zonal Statistics For Loop</title>
      <link>https://community.esri.com/t5/python-questions/python-object-error-on-zonal-statistics-for-loop/m-p/600048#M46899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The faster method that comes to mind is to use a data access module search cursor to get at the geometry, and use that in zonal statistics.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2016 14:55:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-object-error-on-zonal-statistics-for-loop/m-p/600048#M46899</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2016-09-02T14:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: Python Object Error on Zonal Statistics For Loop</title>
      <link>https://community.esri.com/t5/python-questions/python-object-error-on-zonal-statistics-for-loop/m-p/600049#M46900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh gosh! I was using the wrong SearchCursor! Thanks for the recommendation. I've implemented that now and everything seems to be running smoothly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2016 15:19:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-object-error-on-zonal-statistics-for-loop/m-p/600049#M46900</guid>
      <dc:creator>JohnWall</dc:creator>
      <dc:date>2016-09-02T15:19:34Z</dc:date>
    </item>
  </channel>
</rss>

