<?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: ConstructUnion - shift in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/constructunion-shift/m-p/720097#M19187</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;The issue is solved by setting spatial reference to GeometryBag&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Snippet&lt;/P&gt;&lt;PRE style="color: black; background: white; font-size: 13px;"&gt;&lt;SPAN style="color: #2b91af;"&gt;IGeometryBag&lt;/SPAN&gt;&amp;nbsp;geoBag&amp;nbsp;=&amp;nbsp;&lt;SPAN style="color: blue;"&gt;new&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: #2b91af;"&gt;GeometryBagClass&lt;/SPAN&gt;(); geoBag.SpatialReference&amp;nbsp;=&amp;nbsp;geoDataset.SpatialReference;  &lt;SPAN style="color: #2b91af;"&gt;IGeometryCollection&lt;/SPAN&gt;&amp;nbsp;geometriesToUnion&amp;nbsp;=&amp;nbsp;geoBag&amp;nbsp;&lt;SPAN style="color: blue;"&gt;as&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: #2b91af;"&gt;IGeometryCollection&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Mar 2020 10:53:01 GMT</pubDate>
    <dc:creator>M_DJohnson</dc:creator>
    <dc:date>2020-03-12T10:53:01Z</dc:date>
    <item>
      <title>ConstructUnion - shift</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/constructunion-shift/m-p/720096#M19186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The data is in 'GCS_WGS_1984' and creating union polygon using&amp;nbsp;IToplogicalOperator2.ConstructUnion successfully in different type of codes but in both cases found union polygon shift.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji image-1 jive-image" height="212" src="https://community.esri.com/legacyfs/online/483610_unionshift.png" width="398" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;//Case-1&lt;/P&gt;&lt;P&gt;while ((feature = featureCursor.NextFeature()) != null)&lt;BR /&gt;{ &lt;BR /&gt; ITopologicalOperator2 shape = feature.ShapeCopy as ITopologicalOperator2;&lt;BR /&gt; shape.IsKnownSimple_2 = false;&lt;BR /&gt; shape.Simplify();&lt;/P&gt;&lt;P&gt;geometriesToUnion.AddGeometry(shape as IGeometry, ref missing, ref missing); &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;IGeoDataset geoDataset = ipTargetFeatureClass.FeatureDataset as IGeoDataset;&lt;/P&gt;&lt;P&gt;IPolygon UnionPolygon = new PolygonClass();&lt;BR /&gt;UnionPolygon.SpatialReference = geoDataset.SpatialReference;&lt;BR /&gt;ITopologicalOperator2 topologicalOperator;&lt;BR /&gt;topologicalOperator = UnionPolygon as ITopologicalOperator2;&lt;/P&gt;&lt;P&gt;topologicalOperator.ConstructUnion(geometriesToUnion as IEnumGeometry);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Case-2&lt;/P&gt;&lt;P&gt;while ((feature = featureCursor.NextFeature()) != null)&lt;BR /&gt;{ &lt;BR /&gt; ITopologicalOperator2 shape = feature.ShapeCopy as ITopologicalOperator2;&lt;BR /&gt; shape.IsKnownSimple_2 = false;&lt;BR /&gt; shape.Simplify();&lt;/P&gt;&lt;P&gt;geometriesToUnion.AddGeometry(shape as IGeometry); &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;ITopologicalOperator2 topologicalOperator = new PolygonClass(); &lt;BR /&gt;topologicalOperator.ConstructUnion(geometriesToUnion as IEnumGeometry); // union all features&lt;/P&gt;&lt;PRE style="color: black; background: white; font-size: 13px;"&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Please suggest if anything missing in the code&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Feb 2020 11:25:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/constructunion-shift/m-p/720096#M19186</guid>
      <dc:creator>M_DJohnson</dc:creator>
      <dc:date>2020-02-28T11:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: ConstructUnion - shift</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/constructunion-shift/m-p/720097#M19187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;The issue is solved by setting spatial reference to GeometryBag&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Snippet&lt;/P&gt;&lt;PRE style="color: black; background: white; font-size: 13px;"&gt;&lt;SPAN style="color: #2b91af;"&gt;IGeometryBag&lt;/SPAN&gt;&amp;nbsp;geoBag&amp;nbsp;=&amp;nbsp;&lt;SPAN style="color: blue;"&gt;new&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: #2b91af;"&gt;GeometryBagClass&lt;/SPAN&gt;(); geoBag.SpatialReference&amp;nbsp;=&amp;nbsp;geoDataset.SpatialReference;  &lt;SPAN style="color: #2b91af;"&gt;IGeometryCollection&lt;/SPAN&gt;&amp;nbsp;geometriesToUnion&amp;nbsp;=&amp;nbsp;geoBag&amp;nbsp;&lt;SPAN style="color: blue;"&gt;as&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: #2b91af;"&gt;IGeometryCollection&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2020 10:53:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/constructunion-shift/m-p/720097#M19187</guid>
      <dc:creator>M_DJohnson</dc:creator>
      <dc:date>2020-03-12T10:53:01Z</dc:date>
    </item>
  </channel>
</rss>

