<?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: Polygon area calculation with Pro SDK in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/polygon-area-calculation-with-pro-sdk/m-p/1541100#M88528</link>
    <description>&lt;P&gt;Not sure if this is specifically your issue.&amp;nbsp; &amp;nbsp;About a year and a half ago I logged&amp;nbsp;&lt;STRONG&gt;BUG-000154940&lt;/STRONG&gt; related to:&amp;nbsp; &lt;EM&gt;Inaccurate results when calculating the geometry(Area) for shapefiles&lt;/EM&gt; when using Pro.&amp;nbsp; This was the case both from the GUI and from the SDK.&lt;/P&gt;&lt;P&gt;This looks to be the current status:&lt;/P&gt;&lt;P&gt;Submitted&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;January 6, 2023&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Last Modified&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;February 22, 2023&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Applies to&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;ArcGIS Pro&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Version found&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;STRONG&gt;3.0.3&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Operating System&amp;nbsp; &amp;nbsp; &lt;STRONG&gt;Windows OS&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Operating System&amp;nbsp; &amp;nbsp; &lt;STRONG&gt;Version10.0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Status&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;STRONG&gt;In Review&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 20 Sep 2024 22:53:33 GMT</pubDate>
    <dc:creator>RobChasan</dc:creator>
    <dc:date>2024-09-20T22:53:33Z</dc:date>
    <item>
      <title>Polygon area calculation with Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/polygon-area-calculation-with-pro-sdk/m-p/1540878#M88497</link>
      <description>&lt;P&gt;I am migrating an ArcObject module into Pro SDK that calculates the area of polygons that would be copied from one feature class to another.&lt;/P&gt;&lt;P&gt;In the legacy code polygons reprojected into Albers US 1983 coordinate (102003) system from NAD 1983 GCS.&lt;/P&gt;&lt;P&gt;There are discrepancies when calculating area of a polygon between Calculate Geometry on the attribute table and the code I tried in Pro SDK. I need to produce the same result what Calculate Geometry on the attribute table or Measurement tool.&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public static double CalculateArea(List&amp;lt;Geometry&amp;gt; geos)
{
    List&amp;lt;Polygon&amp;gt; polygons = [];
    var spRefAlbers = SpatialReferenceBuilder.CreateSpatialReference(AlbersUS1983WkId);
    foreach (var geo in geos)
    {
        if (GeometryEngine.Instance.Project(geo, spRefAlbers) is Polygon plg)
        {
            polygons.Add(plg);
        }
    }
    PolygonBuilderEx pLbuilderEx = new(polygons, AttributeFlags.None)
    {
        HasZ = false,
        SpatialReference = spRefAlbers
    };

    //Unit for AlbersUS1983 is meter
    return Math.Round((pLbuilderEx.ToGeometry().Area * 0.000247105381), 3);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried pLbuilderEx.ToGeometry().Extent.Area, getting polygon exterior ring, geodesic area calculation etc. but no luck&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Amadeus111_0-1726866166564.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/115595iEE1301F546D7C6E1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Amadeus111_0-1726866166564.png" alt="Amadeus111_0-1726866166564.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Amadeus111_1-1726866192267.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/115596i23954062E1F252E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Amadeus111_1-1726866192267.png" alt="Amadeus111_1-1726866192267.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;There is about 500 acres difference any idea why?&lt;/P&gt;&lt;P&gt;I'd appreciate any help. Thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 22 Sep 2024 17:43:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/polygon-area-calculation-with-pro-sdk/m-p/1540878#M88497</guid>
      <dc:creator>Amadeus111</dc:creator>
      <dc:date>2024-09-22T17:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Polygon area calculation with Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/polygon-area-calculation-with-pro-sdk/m-p/1541100#M88528</link>
      <description>&lt;P&gt;Not sure if this is specifically your issue.&amp;nbsp; &amp;nbsp;About a year and a half ago I logged&amp;nbsp;&lt;STRONG&gt;BUG-000154940&lt;/STRONG&gt; related to:&amp;nbsp; &lt;EM&gt;Inaccurate results when calculating the geometry(Area) for shapefiles&lt;/EM&gt; when using Pro.&amp;nbsp; This was the case both from the GUI and from the SDK.&lt;/P&gt;&lt;P&gt;This looks to be the current status:&lt;/P&gt;&lt;P&gt;Submitted&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;January 6, 2023&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Last Modified&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;February 22, 2023&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Applies to&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;ArcGIS Pro&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Version found&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;STRONG&gt;3.0.3&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Operating System&amp;nbsp; &amp;nbsp; &lt;STRONG&gt;Windows OS&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Operating System&amp;nbsp; &amp;nbsp; &lt;STRONG&gt;Version10.0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Status&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;STRONG&gt;In Review&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2024 22:53:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/polygon-area-calculation-with-pro-sdk/m-p/1541100#M88528</guid>
      <dc:creator>RobChasan</dc:creator>
      <dc:date>2024-09-20T22:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: Polygon area calculation with Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/polygon-area-calculation-with-pro-sdk/m-p/1542750#M88609</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3387"&gt;@RobChasan&lt;/a&gt;I figured the problem. I was getting the geometry from wrong layer. I resolved the issue. Thanks for replying anyway.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2024 22:31:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/polygon-area-calculation-with-pro-sdk/m-p/1542750#M88609</guid>
      <dc:creator>Amadeus111</dc:creator>
      <dc:date>2024-09-25T22:31:52Z</dc:date>
    </item>
  </channel>
</rss>

