<?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: arcpy.da.UpdateCursor using geometry in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-da-updatecursor-using-geometry/m-p/585074#M45939</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In your field list, included are the field names you want to update- you have shape@area which is actually the value, not the field name, Shape_Area.&amp;nbsp; That's another thing too- if you have an fc, don't you already have an area field that is auto-updated?&amp;nbsp; Guess if you're just testing out techniques, that's fine, but probably should additionally check that you are not adding invalid fields, or attempting to add one that already exists.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Enjoy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wayne&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 13 Apr 2013 00:59:42 GMT</pubDate>
    <dc:creator>T__WayneWhitley</dc:creator>
    <dc:date>2013-04-13T00:59:42Z</dc:date>
    <item>
      <title>arcpy.da.UpdateCursor using geometry</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-updatecursor-using-geometry/m-p/585073#M45938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am having a difficult time understanding geometry as a concept accessed by the da module.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, I created a new feature class using the clip geoprocessing tool. I want to update the "HECTARES" field, as well as add a "Shape_Area" field that is updated with Shape@Area geometry.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
arcpy.Clip_analysis(fireLayer,refugeLayer,outLayer)
arcpy.AddField_management(outLayer,"Shape_Area", "DOUBLE")
updateRows = arcpy.da.UpdateCursor\
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (outLayer,["HECTARES","Shape@Area"])

for row in updateRows: #fields --&amp;gt; 0:Hectares, 1:ShapeArea
&amp;nbsp;&amp;nbsp;&amp;nbsp; HA = row[1]/10000 #Area in hectares
&amp;nbsp;&amp;nbsp;&amp;nbsp; row[0] = HA #assign value to each row of Hectares
&amp;nbsp;&amp;nbsp;&amp;nbsp; row[1] = ["Shape@Area"]
&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRows.updateRow(row) #save it by using the updateRow function
del updateRows # unlock cursor
del row #remove cursor pointer &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This code will update my "HECTARES" field if I comment out the line&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[1] = ["Shape@Area"]&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;which leads me to believe that while row[1] remains empty, it still has access to the Shape@Area geometry.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 22:39:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-updatecursor-using-geometry/m-p/585073#M45938</guid>
      <dc:creator>BrittaSchroeder</dc:creator>
      <dc:date>2013-04-12T22:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.UpdateCursor using geometry</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-updatecursor-using-geometry/m-p/585074#M45939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In your field list, included are the field names you want to update- you have shape@area which is actually the value, not the field name, Shape_Area.&amp;nbsp; That's another thing too- if you have an fc, don't you already have an area field that is auto-updated?&amp;nbsp; Guess if you're just testing out techniques, that's fine, but probably should additionally check that you are not adding invalid fields, or attempting to add one that already exists.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Enjoy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wayne&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Apr 2013 00:59:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-updatecursor-using-geometry/m-p/585074#M45939</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-04-13T00:59:42Z</dc:date>
    </item>
  </channel>
</rss>

