<?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 Union discards ellipses in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/union-discards-ellipses/m-p/1677638#M13377</link>
    <description>&lt;P&gt;Running an addin in ArcGIS Pro v3.3.&amp;nbsp; When `GeometryEngine.Instance.Union(...)` is&amp;nbsp;given ellipses (or apparently anything even created &lt;U&gt;&lt;EM&gt;from&lt;/EM&gt;&lt;/U&gt; ellipses), it produces empty geometries.&amp;nbsp; Has anyone seen this before &amp;amp; come up with a workaround?&amp;nbsp; Thanks!&lt;/P&gt;&lt;P&gt;This code . . .&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;List&amp;lt;Polygon&amp;gt; polygonParts = [];
foreach (Layer layer in layers)
{

    // Stuff omitted for brevity

    polygonFeatures = polygonFeatures.Where(p =&amp;gt; p is not null &amp;amp;&amp;amp; !p.IsEmpty)
        .Select(polygon =&amp;gt;
        {
            // I tried adding this because I figured the elliptical curves were the issue, but clearly not.  Note that circles DON'T need this treatment for Union to handle them appropriately.
            if (polygon.HasCurves)
            {
                Log.Information("Pre-densified polygon has {0} vertices and is empty: {1}", polygon.PointCount, polygon.IsEmpty);
                polygon = (Polygon)GeometryEngine.Instance.DensifyByAngle(polygon, -1);
                Log.Information("Densified polygon has {0} vertices, is empty({1}), has area({2}), and has curves({3})", polygon.PointCount, polygon.IsEmpty, polygon.Area, polygon.HasCurves);
            }
            return polygon;
        })
        .ToArray();
    polygonParts.AddRange(polygonFeatures);
}

Log.Information("Creating a union from {0} selected features in these layers: {1}", polygonParts.Count, layers.Select(layer =&amp;gt; layer.Name));
var unionGeometry = await QueuedTask.Run(() =&amp;gt; GeometryEngine.Instance.Union(polygonParts));
Log.Information("Unioned geometry has {0} vertices and is empty({1})", unionGeometry.PointCount, unionGeometry.IsEmpty);
var unionPolygon = (Polygon)unionGeometry;
Log.Information("Unioned polygon has area({0}), and has curves({1})", unionPolygon.Area, unionPolygon.HasCurves);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;. . . produces this log when given ellipses (note the zero area, emptiness, and zero vertices) . . .&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[11:48:03 INFO v1.0] Pre-densified polygon has 2 vertices and is empty: false
[11:48:03 INFO v1.0] Densified polygon has 37 vertices, is empty(false), has area(-11803.5397706948), and has curves(false)
[11:48:03 INFO v1.0] Pre-densified polygon has 2 vertices and is empty: false
[11:48:03 INFO v1.0] Densified polygon has 37 vertices, is empty(false), has area(-11803.5397706948), and has curves(false)
[11:48:03 INFO v1.0] Creating a union from 2 selected features in these layers: ["Graphics Layer"]
[11:48:03 INFO v1.0] Unioned geometry has 0 vertices and is empty(true)
[11:48:03 INFO v1.0] Unioned polygon has area(0), and has curves(false)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;. . . and this log when given circles&amp;nbsp;(note the nonzero area, non-emptiness, and nonzero vertices) . . .&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[11:57:40 INFO v1.0] Pre-densified polygon has 2 vertices and is empty: false
[11:57:40 INFO v1.0] Densified polygon has 37 vertices, is empty(false), has area(7722.7340715872815), and has curves(false)
[11:57:40 INFO v1.0] Pre-densified polygon has 2 vertices and is empty: false
[11:57:40 INFO v1.0] Densified polygon has 37 vertices, is empty(false), has area(7722.7340715872815), and has curves(false)
[11:57:40 INFO v1.0] Creating a union from 2 selected features in these layers: ["Graphics Layer"]
[11:57:40 INFO v1.0] Unioned geometry has 74 vertices and is empty(false)
[11:57:40 INFO v1.0] Unioned polygon has area(15445.469156841702), and has curves(false)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Jan 2026 20:10:18 GMT</pubDate>
    <dc:creator>DanNarsavage_IDWR</dc:creator>
    <dc:date>2026-01-13T20:10:18Z</dc:date>
    <item>
      <title>Union discards ellipses</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/union-discards-ellipses/m-p/1677638#M13377</link>
      <description>&lt;P&gt;Running an addin in ArcGIS Pro v3.3.&amp;nbsp; When `GeometryEngine.Instance.Union(...)` is&amp;nbsp;given ellipses (or apparently anything even created &lt;U&gt;&lt;EM&gt;from&lt;/EM&gt;&lt;/U&gt; ellipses), it produces empty geometries.&amp;nbsp; Has anyone seen this before &amp;amp; come up with a workaround?&amp;nbsp; Thanks!&lt;/P&gt;&lt;P&gt;This code . . .&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;List&amp;lt;Polygon&amp;gt; polygonParts = [];
foreach (Layer layer in layers)
{

    // Stuff omitted for brevity

    polygonFeatures = polygonFeatures.Where(p =&amp;gt; p is not null &amp;amp;&amp;amp; !p.IsEmpty)
        .Select(polygon =&amp;gt;
        {
            // I tried adding this because I figured the elliptical curves were the issue, but clearly not.  Note that circles DON'T need this treatment for Union to handle them appropriately.
            if (polygon.HasCurves)
            {
                Log.Information("Pre-densified polygon has {0} vertices and is empty: {1}", polygon.PointCount, polygon.IsEmpty);
                polygon = (Polygon)GeometryEngine.Instance.DensifyByAngle(polygon, -1);
                Log.Information("Densified polygon has {0} vertices, is empty({1}), has area({2}), and has curves({3})", polygon.PointCount, polygon.IsEmpty, polygon.Area, polygon.HasCurves);
            }
            return polygon;
        })
        .ToArray();
    polygonParts.AddRange(polygonFeatures);
}

Log.Information("Creating a union from {0} selected features in these layers: {1}", polygonParts.Count, layers.Select(layer =&amp;gt; layer.Name));
var unionGeometry = await QueuedTask.Run(() =&amp;gt; GeometryEngine.Instance.Union(polygonParts));
Log.Information("Unioned geometry has {0} vertices and is empty({1})", unionGeometry.PointCount, unionGeometry.IsEmpty);
var unionPolygon = (Polygon)unionGeometry;
Log.Information("Unioned polygon has area({0}), and has curves({1})", unionPolygon.Area, unionPolygon.HasCurves);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;. . . produces this log when given ellipses (note the zero area, emptiness, and zero vertices) . . .&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[11:48:03 INFO v1.0] Pre-densified polygon has 2 vertices and is empty: false
[11:48:03 INFO v1.0] Densified polygon has 37 vertices, is empty(false), has area(-11803.5397706948), and has curves(false)
[11:48:03 INFO v1.0] Pre-densified polygon has 2 vertices and is empty: false
[11:48:03 INFO v1.0] Densified polygon has 37 vertices, is empty(false), has area(-11803.5397706948), and has curves(false)
[11:48:03 INFO v1.0] Creating a union from 2 selected features in these layers: ["Graphics Layer"]
[11:48:03 INFO v1.0] Unioned geometry has 0 vertices and is empty(true)
[11:48:03 INFO v1.0] Unioned polygon has area(0), and has curves(false)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;. . . and this log when given circles&amp;nbsp;(note the nonzero area, non-emptiness, and nonzero vertices) . . .&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[11:57:40 INFO v1.0] Pre-densified polygon has 2 vertices and is empty: false
[11:57:40 INFO v1.0] Densified polygon has 37 vertices, is empty(false), has area(7722.7340715872815), and has curves(false)
[11:57:40 INFO v1.0] Pre-densified polygon has 2 vertices and is empty: false
[11:57:40 INFO v1.0] Densified polygon has 37 vertices, is empty(false), has area(7722.7340715872815), and has curves(false)
[11:57:40 INFO v1.0] Creating a union from 2 selected features in these layers: ["Graphics Layer"]
[11:57:40 INFO v1.0] Unioned geometry has 74 vertices and is empty(false)
[11:57:40 INFO v1.0] Unioned polygon has area(15445.469156841702), and has curves(false)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jan 2026 20:10:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/union-discards-ellipses/m-p/1677638#M13377</guid>
      <dc:creator>DanNarsavage_IDWR</dc:creator>
      <dc:date>2026-01-13T20:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: Union discards ellipses</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/union-discards-ellipses/m-p/1677705#M13379</link>
      <description>&lt;P&gt;The `DensifyByAngle(...)` method doesn't seem to work, but `Buffer(...)` does.&amp;nbsp; I made this extension method that buffers by a tiny distance then unbuffers by the same distance . . .&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;using ArcGIS.Core.Geometry;
using Serilog;
using EsriPolygon = ArcGIS.Core.Geometry.Polygon;

namespace IDWR.WREdit.Contracts.Extensions;

/// &amp;lt;summary&amp;gt;
/// Offers extension methods for Esri geometries
/// &amp;lt;/summary&amp;gt;
public static class EsriGeometryExtensions
{
    /// &amp;lt;summary&amp;gt;
    /// The &amp;lt;see cref="GeometryEngine"/&amp;gt; class has shown some intolerance for ellipses. This handles the problem by replacing any curves with a splined approximation
    /// &amp;lt;/summary&amp;gt;
    /// &amp;lt;param name="polygon"&amp;gt;Geometry to be splined&amp;lt;/param&amp;gt;
    /// &amp;lt;remarks&amp;gt;See work item 78279&amp;lt;/remarks&amp;gt;
    public static EsriPolygon SplineEllipse(this EsriPolygon polygon)
    {
        if (!polygon.HasCurves) return polygon;
        Log.Debug("Pre-densified polygon has {0} vertices and is empty: {1}", polygon.PointCount, polygon.IsEmpty);
        polygon = (Polygon)GeometryEngine.Instance.Buffer(
            GeometryEngine.Instance.Buffer(
                polygon,
                0.1),
            -0.1);
        Log.Debug("Densified polygon has {0} vertices, is empty({1}), has area({2}), and has curves({3})", polygon.PointCount, polygon.IsEmpty, polygon.Area, polygon.HasCurves);
        return polygon;
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;. . . and now the code looks like below, and the polygon that comes out the end is valid even when the inputs include ellipses.&amp;nbsp; Not a fix, but a workaround until the problems in `GeometryEngine` are resolved.&amp;nbsp; Maybe when we finally upgrade past v3.3?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;List&amp;lt;Polygon&amp;gt; polygonParts = [];
foreach (Layer layer in layers)
{
    // Stuff omitted for brevity
    polygonFeatures = polygonFeatures.Where(p =&amp;gt; p is not null &amp;amp;&amp;amp; !p.IsEmpty)
        .Select(polygon =&amp;gt; polygon.SplineEllipse())
        .ToArray();
    polygonParts.AddRange(polygonFeatures);
}

Log.Information("Creating a union from {0} selected features in these layers: {1}", polygonParts.Count, layers.Select(layer =&amp;gt; layer.Name));
var unionGeometry = await QueuedTask.Run(() =&amp;gt; geometryEngine.Union(polygonParts));
Log.Debug("Unioned geometry has {0} vertices and is empty({1})", unionGeometry.PointCount, unionGeometry.IsEmpty);
var unionPolygon = (Polygon)unionGeometry;
Log.Debug("Unioned polygon has area({0}), and has curves({1})", unionPolygon.Area, unionPolygon.HasCurves);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jan 2026 23:52:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/union-discards-ellipses/m-p/1677705#M13379</guid>
      <dc:creator>DanNarsavage_IDWR</dc:creator>
      <dc:date>2026-01-13T23:52:34Z</dc:date>
    </item>
  </channel>
</rss>

