<?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: centroid of the polygon in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centroid-of-the-polygon/m-p/649719#M60606</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am aiming to consume a Public Building Plot areas Map service through ArcMap and generate/export the plots centroids to a feature class to another location. Is there any geoprocessing tool/service able to perform this on a Map service?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Ref.&lt;/STRONG&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There is this python script that calculates the centroids of polygon feature classes but &lt;/SPAN&gt;&lt;STRONG&gt;only locally&lt;/STRONG&gt;&lt;SPAN&gt; :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;Calculate centroids&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN style="text-decoration:underline;"&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00170000004m000000"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//00170000004m000000&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please Help !&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 May 2014 10:43:18 GMT</pubDate>
    <dc:creator>El_BoukfaouiReda</dc:creator>
    <dc:date>2014-05-12T10:43:18Z</dc:date>
    <item>
      <title>centroid of the polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centroid-of-the-polygon/m-p/649715#M60602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to calculate the centroid of the polygon .&amp;nbsp; I tried using Polygon.getExtent().getCenter( ) , but this fn does not return the true center , for example , if the polygon is C shaped.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any thoughts in this aspect will be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nidhi.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2011 13:48:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centroid-of-the-polygon/m-p/649715#M60602</guid>
      <dc:creator>nidhiarora</dc:creator>
      <dc:date>2011-03-30T13:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: centroid of the polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centroid-of-the-polygon/m-p/649716#M60603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi,&lt;BR /&gt;I want to calculate the centroid of the polygon .&amp;nbsp; I tried using Polygon.getExtent().getCenter( ) , but this fn does not return the true center , for example , if the polygon is C shaped.&lt;BR /&gt;Any thoughts in this aspect will be appreciated.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Nidhi.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If the polygon is the result of a task(find, query, identify) on a map/feature service, you could add two fields (x, y) on the polygon layer and populate centroid's x and y using calculate geometry on ArcMap. So when you got the polygon, you could fetch x and y using graphic attributes["x"] and attributes["y"].&amp;nbsp; If the polygon is the result of a drawing, sorry the current JS api esri.Geometry doesn't have such method as getTrueCentroid. In this case, you might want to create a samll python script as a gp service to calculate centroid of the polyon. Because in Arcpy, Geometry does have a method like trueCentroid(or something like that-can't remember exactly). Another thought: A polyon locator will return centroid point as a result...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2011 20:23:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centroid-of-the-polygon/m-p/649716#M60603</guid>
      <dc:creator>HemingZhu</dc:creator>
      <dc:date>2011-04-05T20:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: centroid of the polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centroid-of-the-polygon/m-p/649717#M60604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thnx a lot for your inputs. I ll try the GP service.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2011 19:52:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centroid-of-the-polygon/m-p/649717#M60604</guid>
      <dc:creator>nidhiarora</dc:creator>
      <dc:date>2011-04-06T19:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: centroid of the polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centroid-of-the-polygon/m-p/649718#M60605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is a little late, but you might find the GeometryService.labelPoints() method useful here. It will return a point that is guaranteed to be within the polygon. It may not be the literal centroid, but it sounds like you're more concerned about the point being within the polygon.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/geometryservice.htm#labelPoints"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/geometryservice.htm#labelPoints&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 21:13:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centroid-of-the-polygon/m-p/649718#M60605</guid>
      <dc:creator>BryanBaker</dc:creator>
      <dc:date>2011-08-10T21:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: centroid of the polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centroid-of-the-polygon/m-p/649719#M60606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am aiming to consume a Public Building Plot areas Map service through ArcMap and generate/export the plots centroids to a feature class to another location. Is there any geoprocessing tool/service able to perform this on a Map service?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Ref.&lt;/STRONG&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There is this python script that calculates the centroids of polygon feature classes but &lt;/SPAN&gt;&lt;STRONG&gt;only locally&lt;/STRONG&gt;&lt;SPAN&gt; :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;Calculate centroids&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN style="text-decoration:underline;"&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00170000004m000000"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//00170000004m000000&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please Help !&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2014 10:43:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/centroid-of-the-polygon/m-p/649719#M60606</guid>
      <dc:creator>El_BoukfaouiReda</dc:creator>
      <dc:date>2014-05-12T10:43:18Z</dc:date>
    </item>
  </channel>
</rss>

