<?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 calculate_area_for_selection on unit tests after 2.9.0 upgrade in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-area-for-selection-on-unit-tests-after-2/m-p/1120845#M48401</link>
    <description>&lt;P&gt;After upgrading to ArcGIS Pro 2.9.0 , my unit tests running arcpy.management.CalculateGeometryAttributes&lt;/P&gt;&lt;P&gt;have been failing with the error below.&lt;/P&gt;&lt;P&gt;The code works inside the ArcGIS Pro application without issue, but fails when run from the command line.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;File "C:\Users\Jenkins_SA\Documents\Jenkins_Home\Hal\LRG_HAL_Tools\mapper\Edit_Layer.py", line 301, in calculate_area_for_selection&lt;/P&gt;&lt;P&gt;"SAME_AS_INPUT")&lt;/P&gt;&lt;P&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 4153, in CalculateGeometryAttributes&lt;/P&gt;&lt;P&gt;raise e&lt;/P&gt;&lt;P&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 4150, in CalculateGeometryAttributes&lt;/P&gt;&lt;P&gt;retval = convertArcObjectToPythonObject(gp.CalculateGeometryAttributes_management(*gp_fixargs((in_features, geometry_property, length_unit, area_unit, coordinate_system, coordinate_format), True)))&lt;/P&gt;&lt;P&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 512, in &amp;lt;lambda&amp;gt;&lt;/P&gt;&lt;P&gt;return lambda *args: val(*gp_fixargs(args, True))&lt;/P&gt;&lt;P&gt;arcgisscripting.ExecuteError: Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;File "c:\program files\arcgis\pro\Resources\ArcToolbox\scripts\calculategeometry.py", line 276, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;CalculateGeometry(fc, properties, lUnit, aUnit, cs, cformat)&lt;/P&gt;&lt;P&gt;File "c:\program files\arcgis\pro\Resources\ArcToolbox\scripts\calculategeometry.py", line 125, in CalculateGeometry&lt;/P&gt;&lt;P&gt;ucur.updateRow(row)&lt;/P&gt;&lt;P&gt;RuntimeError: An edit operation is required.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Command That Leads To Error:&lt;/P&gt;&lt;P&gt;The call:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.management.CalculateGeometryAttributes(self.the_layer, "acres AREA", '', "ACRES",&lt;BR /&gt;'PROJCS["NAD_1983_StatePlane_New_Mexico_Central_FIPS_3002_Feet",'&lt;BR /&gt;'GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",'&lt;BR /&gt;'SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM['&lt;BR /&gt;'"Greenwich",0.0],UNIT["Degree",0.0174532925199433]],'&lt;BR /&gt;'PROJECTION["Transverse_Mercator"],PARAMETER['&lt;BR /&gt;'"False_Easting",1640416.666666667],PARAMETER['&lt;BR /&gt;'"False_Northing",0.0],PARAMETER["Central_Meridian",'&lt;BR /&gt;'-106.25],PARAMETER["Scale_Factor",0.9999],PARAMETER['&lt;BR /&gt;'"Latitude_Of_Origin",31.0],UNIT["Foot_US",'&lt;BR /&gt;'0.3048006096012192]]',&lt;BR /&gt;"SAME_AS_INPUT")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Nov 2021 17:00:08 GMT</pubDate>
    <dc:creator>IanAlexander</dc:creator>
    <dc:date>2021-11-29T17:00:08Z</dc:date>
    <item>
      <title>calculate_area_for_selection on unit tests after 2.9.0 upgrade</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-area-for-selection-on-unit-tests-after-2/m-p/1120845#M48401</link>
      <description>&lt;P&gt;After upgrading to ArcGIS Pro 2.9.0 , my unit tests running arcpy.management.CalculateGeometryAttributes&lt;/P&gt;&lt;P&gt;have been failing with the error below.&lt;/P&gt;&lt;P&gt;The code works inside the ArcGIS Pro application without issue, but fails when run from the command line.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;File "C:\Users\Jenkins_SA\Documents\Jenkins_Home\Hal\LRG_HAL_Tools\mapper\Edit_Layer.py", line 301, in calculate_area_for_selection&lt;/P&gt;&lt;P&gt;"SAME_AS_INPUT")&lt;/P&gt;&lt;P&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 4153, in CalculateGeometryAttributes&lt;/P&gt;&lt;P&gt;raise e&lt;/P&gt;&lt;P&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 4150, in CalculateGeometryAttributes&lt;/P&gt;&lt;P&gt;retval = convertArcObjectToPythonObject(gp.CalculateGeometryAttributes_management(*gp_fixargs((in_features, geometry_property, length_unit, area_unit, coordinate_system, coordinate_format), True)))&lt;/P&gt;&lt;P&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 512, in &amp;lt;lambda&amp;gt;&lt;/P&gt;&lt;P&gt;return lambda *args: val(*gp_fixargs(args, True))&lt;/P&gt;&lt;P&gt;arcgisscripting.ExecuteError: Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;File "c:\program files\arcgis\pro\Resources\ArcToolbox\scripts\calculategeometry.py", line 276, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;CalculateGeometry(fc, properties, lUnit, aUnit, cs, cformat)&lt;/P&gt;&lt;P&gt;File "c:\program files\arcgis\pro\Resources\ArcToolbox\scripts\calculategeometry.py", line 125, in CalculateGeometry&lt;/P&gt;&lt;P&gt;ucur.updateRow(row)&lt;/P&gt;&lt;P&gt;RuntimeError: An edit operation is required.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Command That Leads To Error:&lt;/P&gt;&lt;P&gt;The call:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.management.CalculateGeometryAttributes(self.the_layer, "acres AREA", '', "ACRES",&lt;BR /&gt;'PROJCS["NAD_1983_StatePlane_New_Mexico_Central_FIPS_3002_Feet",'&lt;BR /&gt;'GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",'&lt;BR /&gt;'SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM['&lt;BR /&gt;'"Greenwich",0.0],UNIT["Degree",0.0174532925199433]],'&lt;BR /&gt;'PROJECTION["Transverse_Mercator"],PARAMETER['&lt;BR /&gt;'"False_Easting",1640416.666666667],PARAMETER['&lt;BR /&gt;'"False_Northing",0.0],PARAMETER["Central_Meridian",'&lt;BR /&gt;'-106.25],PARAMETER["Scale_Factor",0.9999],PARAMETER['&lt;BR /&gt;'"Latitude_Of_Origin",31.0],UNIT["Foot_US",'&lt;BR /&gt;'0.3048006096012192]]',&lt;BR /&gt;"SAME_AS_INPUT")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 17:00:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-area-for-selection-on-unit-tests-after-2/m-p/1120845#M48401</guid>
      <dc:creator>IanAlexander</dc:creator>
      <dc:date>2021-11-29T17:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: calculate_area_for_selection on unit tests after 2.9.0 upgrade</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-area-for-selection-on-unit-tests-after-2/m-p/1120891#M48406</link>
      <description>&lt;P&gt;see if&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/add-geometry-attributes.htm" target="_blank" rel="noopener"&gt;Add Geometry Attributes (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;works and if does, check these out&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDExNTA1Mg==" target="_blank"&gt;BUG-000115052: The Calculate Geometry Attributes tool fails with an.. (esri.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDEzNzg0OQ==" target="_blank"&gt;BUG-000137849: The Calculate Geometry Attributes geoprocessing tool.. (esri.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;or open a case with Tech Support&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 18:02:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-area-for-selection-on-unit-tests-after-2/m-p/1120891#M48406</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-11-29T18:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: calculate_area_for_selection on unit tests after 2.9.0 upgrade</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-area-for-selection-on-unit-tests-after-2/m-p/1121462#M48488</link>
      <description>&lt;P&gt;Thank you for the response.&amp;nbsp; Unfortunately, I cannot add a column to the layer.&amp;nbsp; It would be nice if Add Geometry Attributes had a parameter for the column.&lt;/P&gt;&lt;P&gt;I looked into CalculateField_management with an Arcade expression, which works, but the spatial reference seems to be limited to a wkid , which returns different results than the more specific spacial reference I am using in the original command.&lt;/P&gt;&lt;P&gt;The issue is new, as it did not occur prior to 2.9.0 . I will submit a ticket.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 21:24:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-area-for-selection-on-unit-tests-after-2/m-p/1121462#M48488</guid>
      <dc:creator>IanAlexander</dc:creator>
      <dc:date>2021-11-30T21:24:01Z</dc:date>
    </item>
  </channel>
</rss>

