<?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: Pro SDK GeometryBag Extent not implemented in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/pro-sdk-geometrybag-extent-not-implemented/m-p/1123401#M7426</link>
    <description>&lt;P&gt;Thanks for the nudge, &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/201161"&gt;@KirkKuykendall1&lt;/a&gt;. I installed 2.9 on a VM, and it is indeed implemented! If I could mark your response as the answer, I would.&lt;/P&gt;</description>
    <pubDate>Tue, 07 Dec 2021 16:43:00 GMT</pubDate>
    <dc:creator>tempStephenRhea_NV5</dc:creator>
    <dc:date>2021-12-07T16:43:00Z</dc:date>
    <item>
      <title>Pro SDK GeometryBag Extent not implemented</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/pro-sdk-geometrybag-extent-not-implemented/m-p/827456#M3133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Looking at the GeometryBag in the SDK the extent property is not implemented. Is there another way of getting the extent of the added geometries in the GeometryBag. The samples show how to add geometries using the GeometryBagBuilder, get the GeometryBag and check the geometries added. But not all the functionality as in ArcObjects. Am I missing something?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SDK:&amp;nbsp;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic19574.html" title="https://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic19574.html"&gt;ArcGIS Pro 2.4 API Reference Guide&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Samples:&amp;nbsp;&lt;A class="link-titled" href="https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Geometry" title="https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Geometry"&gt;ProSnippets Geometry · Esri/arcgis-pro-sdk Wiki · GitHub&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2019 12:54:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/pro-sdk-geometrybag-extent-not-implemented/m-p/827456#M3133</guid>
      <dc:creator>Martinvan_der_Westhuizen1</dc:creator>
      <dc:date>2019-08-27T12:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Pro SDK GeometryBag Extent not implemented</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/pro-sdk-geometrybag-extent-not-implemented/m-p/827457#M3134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try iterating through the geometries in the geometrybag, calling the Extent property on each,&amp;nbsp;adding all the extents into a List&amp;lt;Geometry&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then use the GeometryEngine.Instance.Union method.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming all your geometries in the bag are of the same spatial reference this should work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll add an issue to&amp;nbsp;make sure we look at adding an implementation for the GeometryBag.Extent function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Narelle&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Sep 2019 19:31:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/pro-sdk-geometrybag-extent-not-implemented/m-p/827457#M3134</guid>
      <dc:creator>NarelleChedzey</dc:creator>
      <dc:date>2019-09-05T19:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Pro SDK GeometryBag Extent not implemented</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/pro-sdk-geometrybag-extent-not-implemented/m-p/827458#M3135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Narelle,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried your suggestion but getting "ArcGIS.Core.Geometry.GeometryObjectException: 'GeometryObjectException: The geometry parameter was of the wrong type for the method.'". I'm working with different types of geometries, Points, Lines and some times polygons as one set for the GeometryBag to get the extent of all in GeometryBag. Think it doesn't like the extents of the points when doing the&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;GeometryEngine.Instance.Union.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added a workaround for the interim where I calculate the xMin,&amp;nbsp;xMax, yMin and&amp;nbsp;yMax from all the geometry extents and use the&amp;nbsp;EnvelopeBuilder.CreateEnvelope(xMin, yMin, xMax, yMax, toSpatialReference) to build the &lt;SPAN style="color: #000000;"&gt;smallest&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;Envelope.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for looking into it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2019 08:37:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/pro-sdk-geometrybag-extent-not-implemented/m-p/827458#M3135</guid>
      <dc:creator>Martinvan_der_Westhuizen1</dc:creator>
      <dc:date>2019-09-06T08:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Pro SDK GeometryBag Extent not implemented</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/pro-sdk-geometrybag-extent-not-implemented/m-p/1123090#M7418</link>
      <description>&lt;P&gt;Hey Narelle,&lt;/P&gt;&lt;P&gt;This is still not implemented in 2.8.1, and I don't see anything in the 2.9 release notes that implies a fix there either. Do you know when this will be implemented?&lt;/P&gt;&lt;P&gt;I tried the same workaround you recommended but got the same error as Martin. The workaround I'm using is to keep a list of Polygons and build a Multipoint with the points, call union on the polygon list, then union that extent with the Multipoint extent.&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Stephen&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 19:41:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/pro-sdk-geometrybag-extent-not-implemented/m-p/1123090#M7418</guid>
      <dc:creator>tempStephenRhea_NV5</dc:creator>
      <dc:date>2021-12-06T19:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: Pro SDK GeometryBag Extent not implemented</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/pro-sdk-geometrybag-extent-not-implemented/m-p/1123101#M7419</link>
      <description>&lt;P&gt;This works for me with 2.9 (see Extent at end)&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private static void Test()
{
    //from here: https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/#topic20909.html
    using (GeometryBagBuilder builder = new GeometryBagBuilder(SpatialReferences.WGS84))
    {
        GeometryBag emptyBag = builder.ToGeometry();
        // emptyBag.IsEmpty = true

        MapPoint point = MapPointBuilder.CreateMapPoint(1, 2, SpatialReferences.WebMercator);
        builder.AddGeometry(point);
        // builder.CountGeometries = 1

        GeometryBag geometryBag = builder.ToGeometry();
        // geometryBag.PartCount = 1
        // geometryBag.PointCount = 1
        // geometryBag.IsEmpty = false

        IReadOnlyList&amp;lt;Geometry&amp;gt; geometries = geometryBag.Geometries;
        // geometries.Count = 1
        // geometries[0] is MapPoint with a sr of WGS84

        bool isEqual = geometryBag.IsEqual(emptyBag);   // isEqual = false

        List&amp;lt;Coordinate2D&amp;gt; coords2D = new List&amp;lt;Coordinate2D&amp;gt;()
        {
            new Coordinate2D(0, 0),
            new Coordinate2D(0, 1),
            new Coordinate2D(1, 1),
            new Coordinate2D(1, 0)
        };

        Multipoint multipoint = MultipointBuilder.CreateMultipoint(coords2D, SpatialReferences.WGS84);
        builder.InsertGeometry(0, multipoint);
        geometryBag = builder.ToGeometry();
        // geometryBag.PartCount = 2

        geometries = geometryBag.Geometries;
        // geometries.Count = 2
        // geometries[0] is Multipoint
        // geometries[1] is MapPoint

        Polyline polyline = PolylineBuilder.CreatePolyline(coords2D, SpatialReferences.WebMercator);
        builder.AddGeometry(polyline);
        //builder.RemoveGeometry(1);
        geometryBag = builder.ToGeometry();
        // geometryBag.PartCount = 2

        geometries = geometryBag.Geometries;
        // geometries.Count = 2
        // geometries[0] is Multipoint
        // geometries[1] is Polyline
        var ext = geometryBag.Extent;
        Console.WriteLine(ext.ToJson());
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 19:55:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/pro-sdk-geometrybag-extent-not-implemented/m-p/1123101#M7419</guid>
      <dc:creator>KirkKuykendall1</dc:creator>
      <dc:date>2021-12-06T19:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Pro SDK GeometryBag Extent not implemented</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/pro-sdk-geometrybag-extent-not-implemented/m-p/1123401#M7426</link>
      <description>&lt;P&gt;Thanks for the nudge, &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/201161"&gt;@KirkKuykendall1&lt;/a&gt;. I installed 2.9 on a VM, and it is indeed implemented! If I could mark your response as the answer, I would.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 16:43:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/pro-sdk-geometrybag-extent-not-implemented/m-p/1123401#M7426</guid>
      <dc:creator>tempStephenRhea_NV5</dc:creator>
      <dc:date>2021-12-07T16:43:00Z</dc:date>
    </item>
  </channel>
</rss>

