<?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: Row.shape and .extent in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/row-shape-and-extent/m-p/535161#M41920</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To get the extent xmin bound of the entire layer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcpy.Describe("Layer").extent.XMin&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To get the extent xmin bound of each feature in the layer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;searchRows = arcpy.da.SearchCursor("layer",["OID@","SHAPE@"])
for searchRow in searchRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; oidValue = searchRow[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp; xminExt = searchRow[1].extent.XMin
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "OID = " + str(oidValue) + " has an xmin extent of " + str(xminExt)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 23:15:00 GMT</pubDate>
    <dc:creator>ChrisSnyder</dc:creator>
    <dc:date>2021-12-11T23:15:00Z</dc:date>
    <item>
      <title>Row.shape and .extent</title>
      <link>https://community.esri.com/t5/python-questions/row-shape-and-extent/m-p/535159#M41918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I was figuring out how to get a dataset's extent via python. In the help entry for &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v0000006r000000" rel="nofollow noopener noreferrer" target="_blank"&gt;extent&lt;/A&gt;&lt;SPAN&gt; I was intrigued to note the following sample code snippet:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for row in sCur:
&amp;nbsp;&amp;nbsp;&amp;nbsp; geom = row.shape
&amp;nbsp;&amp;nbsp;&amp;nbsp; ext = geom.extent&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am unable to find any information in the help files on the .shape class. Can anyone tell me about it? I had thought that you had to do something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcpy.Describe("Layer").extent.xmin&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...so I was surprised to see this .shape.extent property. As far as I can see it's undocumented. Where am I going wrong, or where should I look? Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:14:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/row-shape-and-extent/m-p/535159#M41918</guid>
      <dc:creator>JT2</dc:creator>
      <dc:date>2021-12-11T23:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Row.shape and .extent</title>
      <link>https://community.esri.com/t5/python-questions/row-shape-and-extent/m-p/535160#M41919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It is part of the geometry object and is definitely documented.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//018z00000070000000"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//018z00000070000000&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 14:19:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/row-shape-and-extent/m-p/535160#M41919</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2013-03-05T14:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: Row.shape and .extent</title>
      <link>https://community.esri.com/t5/python-questions/row-shape-and-extent/m-p/535161#M41920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To get the extent xmin bound of the entire layer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcpy.Describe("Layer").extent.XMin&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To get the extent xmin bound of each feature in the layer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;searchRows = arcpy.da.SearchCursor("layer",["OID@","SHAPE@"])
for searchRow in searchRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; oidValue = searchRow[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp; xminExt = searchRow[1].extent.XMin
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "OID = " + str(oidValue) + " has an xmin extent of " + str(xminExt)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:15:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/row-shape-and-extent/m-p/535161#M41920</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2021-12-11T23:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: Row.shape and .extent</title>
      <link>https://community.esri.com/t5/python-questions/row-shape-and-extent/m-p/535162#M41921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;It is part of the geometry object and is definitely documented.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//018z00000070000000" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//018z00000070000000&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the pointer, but I cannot find any reference to .shape on the page you linked. There is no property of the Geometry class called 'shape'. So, as far as I can see, my original question stands: where is .shape documented?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Why does the following work, when the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v000000nv000000" rel="nofollow noopener noreferrer" target="_blank"&gt;Row class&lt;/A&gt;&lt;SPAN&gt; doesn't even have a property called 'shape'? And why is there no object model diagram? It's so difficult to see how classes interact when you have to hop from one help entry to the other. We need a diagram to see how they fit together!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; cur = arcpy.SearchCursor("Landscan_Sample")
&amp;gt;&amp;gt;&amp;gt; for row in cur:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print row.shape.extent.XMax
... 
-10.8041666667

-10.7958333333

-10.7875&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:15:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/row-shape-and-extent/m-p/535162#M41921</guid>
      <dc:creator>JT2</dc:creator>
      <dc:date>2021-12-11T23:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: Row.shape and .extent</title>
      <link>https://community.esri.com/t5/python-questions/row-shape-and-extent/m-p/535163#M41922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thanks for the pointer, but I cannot find any reference to .shape on the page you linked. There is no property of the Geometry class called 'shape'. So, as far as I can see, my original question stands: where is .shape documented?&lt;BR /&gt;&lt;BR /&gt;Why does the following work, when the &lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v000000nv000000" rel="nofollow noopener noreferrer" target="_blank"&gt;Row class&lt;/A&gt; doesn't even have a property called 'shape'? And why is there no object model diagram? It's so difficult to see how classes interact when you have to hop from one help entry to the other. We need a diagram to see how they fit together!&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; cur = arcpy.SearchCursor("Landscan_Sample")
&amp;gt;&amp;gt;&amp;gt; for row in cur:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print row.shape.extent.XMax
... 
-10.8041666667

-10.7958333333

-10.7875&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It accesses the shape field, which is a geometry object. You could get the same with &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;geom = row.getValue('Shape')&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:15:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/row-shape-and-extent/m-p/535163#M41922</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2021-12-11T23:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Row.shape and .extent</title>
      <link>https://community.esri.com/t5/python-questions/row-shape-and-extent/m-p/535164#M41923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Oh I see, thanks for pointing that out. Yes, according to this page &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z0000001q000000:"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z0000001q000000:&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;There are two basic ways to get and set field values on a row:&lt;BR /&gt;Using the field name, as in value = row.road_type&lt;BR /&gt;Using getValue and setValue, as in value = row.getValue("road_type")&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How incredibly confusing that there's no way to tell if the .property is referring to a field name or a class/property. And what would happen if your field was called 'length'? Which takes precedence, the field name 'length', or the .length property of the Geometry class? How on earth are we meant to differentiate when reading others' code? Very confusing...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 07:21:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/row-shape-and-extent/m-p/535164#M41923</guid>
      <dc:creator>JT2</dc:creator>
      <dc:date>2013-03-07T07:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: Row.shape and .extent</title>
      <link>https://community.esri.com/t5/python-questions/row-shape-and-extent/m-p/535165#M41924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The properties are all listed in the help which you linked to in a previous post. It is pretty simple to tell the difference. A property of row requires a parameter.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;row.getValue(field)&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Whereas a field referenced by the row object does not.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;row.field&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;If for some reason you happen to have a row with the same name as a property, such as getValue, the property will take precedence. Your example of length doesn't work since it is a property of the geometry object not the row. It is accessed like this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;row.shape.length&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 12:11:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/row-shape-and-extent/m-p/535165#M41924</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2013-03-07T12:11:08Z</dc:date>
    </item>
  </channel>
</rss>

