<?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 Merge polygons (when they're not in a feature layer yet) in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/merge-polygons-when-they-re-not-in-a-feature-layer/m-p/778613#M1040</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a&amp;nbsp;network of triangles (TIN) and when I draw them all on a feature layer I can easily merge them together into one big polygon (or a few polygons) with EditOperation.Merge. Works well and so far so good.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But of course it's a bit silly to draw for example 100000 triangles (which takes ages) and THEN merge them. Instead it would be much better to have the PolygonBuilder create&amp;nbsp;the polygons and then merge them right away and just add one big polygon onto my feature layer. In pseudocode it would look a bit like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; editOp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; polygons &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;List&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;Polygon&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;myTriangles&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Count&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;foreach&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; tr &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; myTriangles&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
   &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; coordinates &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; tr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetCoordinates3D&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
   &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; pg &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; PolygonBuilder&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;CreatePolygon&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;coordinates&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; spatialRef&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
   polygons&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Add&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;pg&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
editOp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Merge&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;polygons&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; editOp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ExecuteAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I know this doesn't work right ouf of the box but is there a way I can do this? After all, the merge functionality is there and I don't see why EditOperation.Merge shouldn't work on a sequence of polygons just as it does work on a sequence of Object IDs...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 08:47:02 GMT</pubDate>
    <dc:creator>RehmSoftware</dc:creator>
    <dc:date>2021-12-12T08:47:02Z</dc:date>
    <item>
      <title>Merge polygons (when they're not in a feature layer yet)</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/merge-polygons-when-they-re-not-in-a-feature-layer/m-p/778613#M1040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a&amp;nbsp;network of triangles (TIN) and when I draw them all on a feature layer I can easily merge them together into one big polygon (or a few polygons) with EditOperation.Merge. Works well and so far so good.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But of course it's a bit silly to draw for example 100000 triangles (which takes ages) and THEN merge them. Instead it would be much better to have the PolygonBuilder create&amp;nbsp;the polygons and then merge them right away and just add one big polygon onto my feature layer. In pseudocode it would look a bit like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; editOp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; polygons &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;List&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;Polygon&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;myTriangles&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Count&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;foreach&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; tr &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; myTriangles&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
   &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; coordinates &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; tr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetCoordinates3D&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
   &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; pg &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; PolygonBuilder&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;CreatePolygon&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;coordinates&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; spatialRef&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
   polygons&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Add&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;pg&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
editOp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Merge&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;polygons&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; editOp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ExecuteAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I know this doesn't work right ouf of the box but is there a way I can do this? After all, the merge functionality is there and I don't see why EditOperation.Merge shouldn't work on a sequence of polygons just as it does work on a sequence of Object IDs...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:47:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/merge-polygons-when-they-re-not-in-a-feature-layer/m-p/778613#M1040</guid>
      <dc:creator>RehmSoftware</dc:creator>
      <dc:date>2021-12-12T08:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: Merge polygons (when they're not in a feature layer yet)</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/merge-polygons-when-they-re-not-in-a-feature-layer/m-p/778614#M1041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;GeometryEngine.Instance.Union should do the same thing:&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic8291.html"&gt;topic8291.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Feb 2020 18:33:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/merge-polygons-when-they-re-not-in-a-feature-layer/m-p/778614#M1041</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2020-02-26T18:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Merge polygons (when they're not in a feature layer yet)</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/merge-polygons-when-they-re-not-in-a-feature-layer/m-p/778615#M1042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's what I was looking for, thank you! Even though I have to call "SimplifyAsFeature" on each polygon before Union processes them correctly (and I'm dead sure these polygons are simple already).. if I don't simplify them I get an Exception:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;System&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ArgumentException&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; Value does not fall within the expected range&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;
   at ArcGIS&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Core&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Internal&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;IGeometryEngineIOP&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GEUnionArray&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;IntPtr&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; handles&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; SpatialReferenceTiny srTiny&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; String wkt&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; String vWkt&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Boolean&lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; outIsKnownSimple&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
   at ArcGIS&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Core&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Geometry&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GeometryEngine&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Union&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;IEnumerable`&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt; geometries&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:47:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/merge-polygons-when-they-re-not-in-a-feature-layer/m-p/778615#M1042</guid>
      <dc:creator>RehmSoftware</dc:creator>
      <dc:date>2021-12-12T08:47:04Z</dc:date>
    </item>
  </channel>
</rss>

