<?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 generate polygon from envelop object (XY min/max coordinates) or extent in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/generate-polygon-from-envelop-object-xy-min-max/m-p/1053786#M10049</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm trying to generate an Envelope object, passing it x and y coordinates min and max.&lt;BR /&gt;Using this object I am trying to generate a polygon but I can't get it.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Envelope extent = new Envelope(enteredPointMin.X, enteredPointMin.Y, enteredPointMax.X, enteredPointMax.Y);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;Is it possible to generate a polygon object from an envelope element or extent? or from XY Min/Max coordinates??&lt;/P&gt;&lt;P&gt;In the JS API it is allowed to generate a polygon form Extent, but in .NET SDK maybe not.&lt;/P&gt;&lt;P&gt;Thanks !&lt;/P&gt;</description>
    <pubDate>Mon, 03 May 2021 14:50:04 GMT</pubDate>
    <dc:creator>geopamplona</dc:creator>
    <dc:date>2021-05-03T14:50:04Z</dc:date>
    <item>
      <title>generate polygon from envelop object (XY min/max coordinates) or extent</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/generate-polygon-from-envelop-object-xy-min-max/m-p/1053786#M10049</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm trying to generate an Envelope object, passing it x and y coordinates min and max.&lt;BR /&gt;Using this object I am trying to generate a polygon but I can't get it.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Envelope extent = new Envelope(enteredPointMin.X, enteredPointMin.Y, enteredPointMax.X, enteredPointMax.Y);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;Is it possible to generate a polygon object from an envelope element or extent? or from XY Min/Max coordinates??&lt;/P&gt;&lt;P&gt;In the JS API it is allowed to generate a polygon form Extent, but in .NET SDK maybe not.&lt;/P&gt;&lt;P&gt;Thanks !&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 14:50:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/generate-polygon-from-envelop-object-xy-min-max/m-p/1053786#M10049</guid>
      <dc:creator>geopamplona</dc:creator>
      <dc:date>2021-05-03T14:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: generate polygon from envelop object (XY min/max coordinates) or extent</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/generate-polygon-from-envelop-object-xy-min-max/m-p/1053814#M10050</link>
      <description>&lt;P&gt;In fact, there seams not to be a method to directly create a polygon from an Envelope.&lt;/P&gt;&lt;P&gt;But this is a way you can do it:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;        private Geometry CreateFromEnvelope(Envelope envelope)
        {
            var builder = new PolygonBuilder(envelope.SpatialReference);
            builder.AddPoint(new MapPoint(envelope.XMin, envelope.YMin));
            builder.AddPoint(new MapPoint(envelope.XMin, envelope.YMax));
            builder.AddPoint(new MapPoint(envelope.XMax, envelope.YMax));
            builder.AddPoint(new MapPoint(envelope.XMax, envelope.YMin));
            return builder.ToGeometry();
        }&lt;/LI-CODE&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 15:39:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/generate-polygon-from-envelop-object-xy-min-max/m-p/1053814#M10050</guid>
      <dc:creator>MaximilianGlas</dc:creator>
      <dc:date>2021-05-03T15:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: generate polygon from envelop object (XY min/max coordinates) or extent</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/generate-polygon-from-envelop-object-xy-min-max/m-p/1053823#M10051</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/11827"&gt;@MaximilianGlas&lt;/a&gt;'s answer is good, but a couple of other thoughts…&lt;/P&gt;&lt;P&gt;Since you already have the coordinates, can you just construct a Polygon instead of an Envelope in the first place? Obviously that depends on your use case.&lt;/P&gt;&lt;P&gt;Polygon has &lt;A href="https://developers.arcgis.com/net/wpf/api-reference/html/M_Esri_ArcGISRuntime_Geometry_Polygon__ctor_1.htm" target="_self"&gt;constructors that take an IEnumerable of MapPoints&lt;/A&gt;. You could use that with the envelope coordinates instead of the PolygonBuilder. I wouldn't say one is preferred over another from a performance perspective (unless you're doing this in a tight loop), but it might be simpler code.&lt;/P&gt;&lt;P&gt;Another way to get a polygon from an Envelope is to use &lt;A href="https://developers.arcgis.com/net/wpf/api-reference/html/M_Esri_ArcGISRuntime_Geometry_GeometryEngine_ConvexHull.htm" target="_self"&gt;GeometryEngine.ConvexHull()&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 15:56:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/generate-polygon-from-envelop-object-xy-min-max/m-p/1053823#M10051</guid>
      <dc:creator>Nicholas-Furness</dc:creator>
      <dc:date>2021-05-03T15:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: generate polygon from envelop object (XY min/max coordinates) or extent</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/generate-polygon-from-envelop-object-xy-min-max/m-p/1053829#M10052</link>
      <description>&lt;P&gt;Thanks !&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 16:01:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/generate-polygon-from-envelop-object-xy-min-max/m-p/1053829#M10052</guid>
      <dc:creator>geopamplona</dc:creator>
      <dc:date>2021-05-03T16:01:31Z</dc:date>
    </item>
  </channel>
</rss>

