<?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 Shape_Area ? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/shape-area/m-p/75335#M6131</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Question re: Shape_Area on Intersect output&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;While in ArcMap, if I direct the output of the Intersect tool to "in_memory", why is it that the "Shape_Area" and "Shape_Length" fields on the output layer table are both set to Null for all rows?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I do same on disk these fields are auto calculated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Reason I ask is that I was automating this in python and made the assumption that "Shape_Area" would be updated based on Intersected polygon properties.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this a bug or can someone set me straight (or provide best practices) on when to assume "Shape_Area" and "Shape_Length" fields are created/updated with respect to overlay tools?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a simple and fast way to update these fields while in_memory?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks so much, b&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Apr 2013 17:56:48 GMT</pubDate>
    <dc:creator>BKS</dc:creator>
    <dc:date>2013-04-22T17:56:48Z</dc:date>
    <item>
      <title>Shape_Area ?</title>
      <link>https://community.esri.com/t5/python-questions/shape-area/m-p/75335#M6131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Question re: Shape_Area on Intersect output&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;While in ArcMap, if I direct the output of the Intersect tool to "in_memory", why is it that the "Shape_Area" and "Shape_Length" fields on the output layer table are both set to Null for all rows?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I do same on disk these fields are auto calculated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Reason I ask is that I was automating this in python and made the assumption that "Shape_Area" would be updated based on Intersected polygon properties.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this a bug or can someone set me straight (or provide best practices) on when to assume "Shape_Area" and "Shape_Length" fields are created/updated with respect to overlay tools?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a simple and fast way to update these fields while in_memory?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks so much, b&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Apr 2013 17:56:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/shape-area/m-p/75335#M6131</guid>
      <dc:creator>BKS</dc:creator>
      <dc:date>2013-04-22T17:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: Shape_Area ?</title>
      <link>https://community.esri.com/t5/python-questions/shape-area/m-p/75336#M6132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Perhaps I can calculate the Shape_Area setting equal to Shape.Area.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But would still like to know if this is a bug or can someone set me straight (or provide best practices) on when to assume "Shape_Area" and "Shape_Length" fields are created/updated with respect to overlay tools?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, b&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Apr 2013 18:15:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/shape-area/m-p/75336#M6132</guid>
      <dc:creator>BKS</dc:creator>
      <dc:date>2013-04-22T18:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Shape_Area ?</title>
      <link>https://community.esri.com/t5/python-questions/shape-area/m-p/75337#M6133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I could be wrong here, but I'm guessing these fields are intentionally not populated in the in_memory workspace to boost performance for in_memory feature classes.&amp;nbsp; Perhaps it makes the processing faster without the extra geometry stuff that would normally be tied to a FC in a gdb.&amp;nbsp; I'm just guessing here and that may be completely wrong.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would suggest maybe using your scratch workspace for these temporary files as a best practice since you will need the area automatically updated.&amp;nbsp; I believe this is always automatically updated in file geodatabases.&amp;nbsp; At 10.1 you can actually set a scratch env workspace or you could set your normal workspace environment to your default geodatabase.&amp;nbsp; On my machine it would be like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;arcpy.env.workspace = r'\\ccasr\users\gis\My Documents\ArcGIS\Default.gdb'&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Apr 2013 18:42:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/shape-area/m-p/75337#M6133</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-04-22T18:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: Shape_Area ?</title>
      <link>https://community.esri.com/t5/python-questions/shape-area/m-p/75338#M6134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Actually I just did a quick test in the interactive window.&amp;nbsp; I was using 10.1, but you can access the area token in an in_memory feature class like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;'SHAPE@AREA'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was able to access the area of an in_memory workspace feature class by using that same token:&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; import arcpy
&amp;gt;&amp;gt;&amp;gt; ws = 'in_memory'
&amp;gt;&amp;gt;&amp;gt; cad = r'G:\Data\Geodatabase\Cedar_County.gdb\JURISDICTION\CORP_LIM'
&amp;gt;&amp;gt;&amp;gt; arcpy.CopyFeatures_management(cad, r'in_memory\corp')
&amp;lt;Result 'in_memory\\corp'&amp;gt;
&amp;gt;&amp;gt;&amp;gt; corp = r'in_memory\corp'
&amp;gt;&amp;gt;&amp;gt; with arcpy.da.SearchCursor(corp, ['SHAPE@AREA']) as rows:
 for row in rows:
&amp;nbsp; print row[0]

&amp;nbsp; 
29602027.3534
5743768.43532
21250061.0234
1176983.15619
23122043.9827
29591444.8893
21709630.032
66368156.0184
56180139.9378
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:54:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/shape-area/m-p/75338#M6134</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-10T22:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: Shape_Area ?</title>
      <link>https://community.esri.com/t5/python-questions/shape-area/m-p/75339#M6135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The Shape_Area and/or Shape_Length fields are &lt;/SPAN&gt;&lt;SPAN style="text-decoration:underline;"&gt;not&lt;/SPAN&gt;&lt;SPAN&gt; auto-populated when using the in_memory workspace. You have to populate then manually if you want to run a query against them, or you can of course use the row's shape object .area and/or .length properties in a cursor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to stay away from cursors, do something like this:&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;arcpy.CalculateField_management("in_memory\\test", "ACRES", "SHAPE.AREA@ACRES", "PYTHON")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Apr 2013 22:15:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/shape-area/m-p/75339#M6135</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2013-04-22T22:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Shape_Area ?</title>
      <link>https://community.esri.com/t5/python-questions/shape-area/m-p/75340#M6136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Caleb and Chris, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for info.&amp;nbsp; This was helpful.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Forgot to update this earlier.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers, b&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Apr 2013 00:08:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/shape-area/m-p/75340#M6136</guid>
      <dc:creator>BKS</dc:creator>
      <dc:date>2013-04-30T00:08:53Z</dc:date>
    </item>
  </channel>
</rss>

