<?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 getCentroid() Seems to not work. in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getcentroid-seems-to-not-work/m-p/238609#M22172</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: mmoles&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have some polygons that are drawn in the middle of the gulf of mexico, but when i do a .getCentroid() , it puts it east of Puerto Rico.&amp;nbsp;&amp;nbsp;&amp;nbsp; I had it draw a 1km circle from that point, and with the circle i did a .getCentroid() and it had the signs backwards. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The circle "center" attribute shows &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;x: -6915389.5593207795&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;y: 2211235.9333326435&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;circle.GetCentriod() shows &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;x: 6915389.573377605, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;y: -2211235.9378281594&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I had 4 polygons all within 1 KM of each other, and I ran trough a loop to draw them and with each one i added console.log(tempPoly.getCentroid());&amp;nbsp;&amp;nbsp; and this is what it outputted:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; x: -6915389.5593207795, y: 2211235.9333326435, ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; x: -6915241.501368446, y: 2211268.289466834, ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; x: 6914871.672864611, y: -2211054.934414348, ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; x: 6914169.460895168, y: -2210864.6600185963, ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tested this on 3.7 and 3.8 both ran into the same issue.&amp;nbsp; Any ideas on whats going on.&amp;nbsp;&amp;nbsp; The sign changes are probably breaking things, but why is it even doing this?&amp;nbsp; Has this worked for anyone or did they release broken code?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So, i figured out that my polygons were technically not closed.&amp;nbsp; The polygons will close themselves, but without a duplicate start\stop point its technically not closed.&amp;nbsp; Circles still the odd issue of the signs being mixed up.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;tempGraphicsCircleLayer.graphics[0].geometry.center&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;spatialReference: Object&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;type: "point"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;x: -10372778.575270642&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;y: 3316803.914099979&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;__proto__: Object&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;tempGraphicsCircleLayer.graphics[0].geometry.getCentroid()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;spatialReference: Object&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;type: "point"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;x: 10372778.548966456&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;y: -3316803.9056921354&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;__proto__: Object&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Apr 2014 17:36:26 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2014-04-08T17:36:26Z</dc:date>
    <item>
      <title>getCentroid() Seems to not work.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getcentroid-seems-to-not-work/m-p/238609#M22172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: mmoles&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have some polygons that are drawn in the middle of the gulf of mexico, but when i do a .getCentroid() , it puts it east of Puerto Rico.&amp;nbsp;&amp;nbsp;&amp;nbsp; I had it draw a 1km circle from that point, and with the circle i did a .getCentroid() and it had the signs backwards. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The circle "center" attribute shows &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;x: -6915389.5593207795&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;y: 2211235.9333326435&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;circle.GetCentriod() shows &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;x: 6915389.573377605, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;y: -2211235.9378281594&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I had 4 polygons all within 1 KM of each other, and I ran trough a loop to draw them and with each one i added console.log(tempPoly.getCentroid());&amp;nbsp;&amp;nbsp; and this is what it outputted:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; x: -6915389.5593207795, y: 2211235.9333326435, ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; x: -6915241.501368446, y: 2211268.289466834, ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; x: 6914871.672864611, y: -2211054.934414348, ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; x: 6914169.460895168, y: -2210864.6600185963, ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tested this on 3.7 and 3.8 both ran into the same issue.&amp;nbsp; Any ideas on whats going on.&amp;nbsp;&amp;nbsp; The sign changes are probably breaking things, but why is it even doing this?&amp;nbsp; Has this worked for anyone or did they release broken code?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So, i figured out that my polygons were technically not closed.&amp;nbsp; The polygons will close themselves, but without a duplicate start\stop point its technically not closed.&amp;nbsp; Circles still the odd issue of the signs being mixed up.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;tempGraphicsCircleLayer.graphics[0].geometry.center&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;spatialReference: Object&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;type: "point"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;x: -10372778.575270642&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;y: 3316803.914099979&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;__proto__: Object&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;tempGraphicsCircleLayer.graphics[0].geometry.getCentroid()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;spatialReference: Object&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;type: "point"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;x: 10372778.548966456&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;y: -3316803.9056921354&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;__proto__: Object&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Apr 2014 17:36:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getcentroid-seems-to-not-work/m-p/238609#M22172</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-04-08T17:36:26Z</dc:date>
    </item>
  </channel>
</rss>

