<?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: get feature extent error in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/get-feature-extent-error/m-p/447773#M35120</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I believe the problem is with the Search cursor.&amp;nbsp; You have:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;sCur = arcpy.SearchCursor("test.shp", "","","ID_1")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When specifying "ID_1" you are limiting the search cursor to this specific field, but you are trying to query the "Shape" field's extent.&amp;nbsp; I would recommend keeping this parameter empty, or including the ''Shape'' field.&amp;nbsp; Ex:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;sCur = arcpy.SearchCursor("test.shp", "","","ID_1; Shape")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;sCur = arcpy.SearchCursor("test.shp")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Aug 2011 10:43:32 GMT</pubDate>
    <dc:creator>JakeSkinner</dc:creator>
    <dc:date>2011-08-04T10:43:32Z</dc:date>
    <item>
      <title>get feature extent error</title>
      <link>https://community.esri.com/t5/python-questions/get-feature-extent-error/m-p/447772#M35119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I was trying to follow an python script example of getting extent of features (Note "test.shp" is polygon feature)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;________________________________________________________&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from arcpy import env&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;env.workspace = "C:/Data/"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;sCur = arcpy.SearchCursor("test.shp", "","","ID_1" )&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Fetch each feature from the cursor and examine the extent properties&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for row in sCur:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; geom = row.shape&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ext = geom.extent&amp;nbsp; # or row.Shape.extent&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Extent of feature:\nXMin: %f, YMin: %f, \nXMax: %f, YMax: %f" % \&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (ext.XMin,ext.YMin,ext.XMax,ext.YMax) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_________________________________________________________________&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The script stopped at "ext = geom.extent". The error message shows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ext = geom.extent&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AttributeError: 'passthrough' object has no attribute 'extent'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know how to fix it. Any idea? Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2011 00:42:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/get-feature-extent-error/m-p/447772#M35119</guid>
      <dc:creator>YinghaiKe</dc:creator>
      <dc:date>2011-08-04T00:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: get feature extent error</title>
      <link>https://community.esri.com/t5/python-questions/get-feature-extent-error/m-p/447773#M35120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I believe the problem is with the Search cursor.&amp;nbsp; You have:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;sCur = arcpy.SearchCursor("test.shp", "","","ID_1")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When specifying "ID_1" you are limiting the search cursor to this specific field, but you are trying to query the "Shape" field's extent.&amp;nbsp; I would recommend keeping this parameter empty, or including the ''Shape'' field.&amp;nbsp; Ex:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;sCur = arcpy.SearchCursor("test.shp", "","","ID_1; Shape")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;sCur = arcpy.SearchCursor("test.shp")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2011 10:43:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/get-feature-extent-error/m-p/447773#M35120</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2011-08-04T10:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: get feature extent error</title>
      <link>https://community.esri.com/t5/python-questions/get-feature-extent-error/m-p/447774#M35121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jake, It works. Thank you very much!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2011 16:29:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/get-feature-extent-error/m-p/447774#M35121</guid>
      <dc:creator>YinghaiKe</dc:creator>
      <dc:date>2011-08-04T16:29:14Z</dc:date>
    </item>
  </channel>
</rss>

