<?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: Draw Polygon between longitude ranges error in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/draw-polygon-between-longitude-ranges-error/m-p/1142577#M76313</link>
    <description>&lt;P&gt;One of the downside of things&amp;nbsp; "automagically" happening... the helpers that get the job done are often forgotten &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Feb 2022 11:55:33 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2022-02-10T11:55:33Z</dc:date>
    <item>
      <title>Draw Polygon between longitude ranges error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/draw-polygon-between-longitude-ranges-error/m-p/1142554#M76309</link>
      <description>&lt;P&gt;I have a problem with creating and drawing a polygon geometry that is located between the longitude margins (basically starts from East of Japan and ends in Alaska)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The way the API is drawing the polygon is basically in the reverse order.&lt;/P&gt;&lt;P&gt;I used the&amp;nbsp;SketchViewModel to draw the desired polygon on a map (see print screen below), and&amp;nbsp; I got the rings in long, lat coordinates as:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;[&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;[&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;150.50951046729438,&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;83.60281202131557&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;],&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;[&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;-151.3277526400206,&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;83.90137770480938&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;],&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;[&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;-147.58991198755575,&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;-83.28282929241126&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;],&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;[&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;-151.7627425692197,&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;-84.13966376019715&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;],&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;[&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;177.9052071073019,&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;-83.43080587654312&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;],&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;[&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;154.09088177466649,&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;-83.43080587654312&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;],&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;[&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;137.0340923764776,&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;-80.80424221760879&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;],&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;[&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;146.74253029609173,&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;-33.83792786815416&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;],&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;[&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;150.50951046729438,&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;83.60281202131557&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;]&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;]&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-02-10 at 10.45.03.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/33586iAF5A7EBAD87305BD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2022-02-10 at 10.45.03.png" alt="Screen Shot 2022-02-10 at 10.45.03.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If then I use the same rings to create a polygon geometry, add it to a graphic layer and plot the layer in the map, the entire map is filled besides the original shape&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-02-10 at 10.46.42.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/33587i7F21BFAA93979B55/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2022-02-10 at 10.46.42.png" alt="Screen Shot 2022-02-10 at 10.46.42.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;&lt;BR /&gt;Isn't the API able to draw the polygon in between the longitudes margins (+180/-180) or is this a bug with the coordinates order?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 09:48:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/draw-polygon-between-longitude-ranges-error/m-p/1142554#M76309</guid>
      <dc:creator>ialixandroae</dc:creator>
      <dc:date>2022-02-10T09:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: Draw Polygon between longitude ranges error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/draw-polygon-between-longitude-ranges-error/m-p/1142567#M76310</link>
      <description>&lt;P&gt;You have to correct for the traversal of the dateline, then it should be fixed when defining the coordinate system.&amp;nbsp; You can't from -150 to +150 without going through 0, hence make -150, -210 or +150 into +210 the delta being the appropriate difference from +/-180&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-questions/programmatically-creating-polygon-from-points-on/m-p/262704" target="_blank"&gt;Solved: Programmatically creating polygon from points on b... - Esri Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 11:16:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/draw-polygon-between-longitude-ranges-error/m-p/1142567#M76310</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-02-10T11:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Draw Polygon between longitude ranges error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/draw-polygon-between-longitude-ranges-error/m-p/1142575#M76312</link>
      <description>&lt;P&gt;Oh, I see. That's interesting.&lt;/P&gt;&lt;P&gt;Other APIs do that automatically for you, you just put in the coordinates and that's it.&lt;/P&gt;&lt;P&gt;Your answer helped me find these examples:&amp;nbsp;&lt;A href="https://codepen.io/andygup/pen/QeyerP" target="_blank"&gt;https://codepen.io/andygup/pen/QeyerP&lt;/A&gt;&amp;nbsp; and &lt;A href="https://community.esri.com/t5/arcgis-api-for-javascript-questions/polyline-not-crossing-the-international-dateline/td-p/565081" target="_blank"&gt;https://community.esri.com/t5/arcgis-api-for-javascript-questions/polyline-not-crossing-the-international-dateline/td-p/565081&lt;/A&gt;&amp;nbsp;(&lt;A href="https://jsbin.com/xegicih/2/edit?html,output" target="_blank"&gt;https://jsbin.com/xegicih/2/edit?html,output&lt;/A&gt; ), and it seems that getting a new geometry using&amp;nbsp;geodesicUtils.geodesicDensify() +&amp;nbsp;normalizeUtils.normalizeCentralMeridian() does the trick.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 11:45:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/draw-polygon-between-longitude-ranges-error/m-p/1142575#M76312</guid>
      <dc:creator>ialixandroae</dc:creator>
      <dc:date>2022-02-10T11:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Draw Polygon between longitude ranges error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/draw-polygon-between-longitude-ranges-error/m-p/1142577#M76313</link>
      <description>&lt;P&gt;One of the downside of things&amp;nbsp; "automagically" happening... the helpers that get the job done are often forgotten &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 11:55:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/draw-polygon-between-longitude-ranges-error/m-p/1142577#M76313</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-02-10T11:55:33Z</dc:date>
    </item>
  </channel>
</rss>

