<?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: How to get the centroid of a &amp;quot;C&amp;quot; or &amp;quot;U&amp;quot; shape like polygon? in Java Maps SDK Questions</title>
    <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-get-the-centroid-of-a-quot-c-quot-or-quot-u/m-p/543658#M1698</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For the Java API, &lt;A href="https://developers.arcgis.com/java/api-reference/com/esri/core/geometry/GeometryEngine.html#getLabelPointForPolygon(com.esri.core.geometry.Polygon,%20com.esri.core.geometry.SpatialReference)"&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;getLabelPointForPolygon&lt;/SPAN&gt; &lt;/A&gt;in the &lt;A href="https://developers.arcgis.com/java/api-reference/com/esri/core/geometry/GeometryEngine.html"&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;GeometryEngine&lt;/SPAN&gt; &lt;/A&gt;class.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Sep 2016 15:10:14 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2016-09-16T15:10:14Z</dc:date>
    <item>
      <title>How to get the centroid of a "C" or "U" shape like polygon?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-get-the-centroid-of-a-quot-c-quot-or-quot-u/m-p/543652#M1692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anyone know how to get the centroid of a "C", or "U" shape like polygon and the point need to be inside the polygon some where near the centre?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2016 02:15:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-to-get-the-centroid-of-a-quot-c-quot-or-quot-u/m-p/543652#M1692</guid>
      <dc:creator>Joo_PinTan</dc:creator>
      <dc:date>2016-09-16T02:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the centroid of a "C" or "U" shape like polygon?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-get-the-centroid-of-a-quot-c-quot-or-quot-u/m-p/543653#M1693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;i&lt;/STRONG&gt;n most Arc* products this is referred to as a LabelPoint, so look for some incarnation of that term&lt;/P&gt;&lt;P&gt;ie&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;The point at which the label is located. The labelPoint is always located within or on a feature.&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2016 06:55:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-to-get-the-centroid-of-a-quot-c-quot-or-quot-u/m-p/543653#M1693</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-09-16T06:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the centroid of a "C" or "U" shape like polygon?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-get-the-centroid-of-a-quot-c-quot-or-quot-u/m-p/543654#M1694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In &lt;A href="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/feature-to-point.htm"&gt;Feature to Point Tool&lt;/A&gt;, choose "INSIDE" as the point location.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2016 07:36:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-to-get-the-centroid-of-a-quot-c-quot-or-quot-u/m-p/543654#M1694</guid>
      <dc:creator>JayantaPoddar</dc:creator>
      <dc:date>2016-09-16T07:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the centroid of a "C" or "U" shape like polygon?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-get-the-centroid-of-a-quot-c-quot-or-quot-u/m-p/543655#M1695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #8b8b8b; background-color: rgba(132, 132, 132, 0.0392157);"&gt;I&amp;nbsp;need to use&amp;nbsp;ArcGis Runtime SDK for Java API to code it.&amp;nbsp;Feature to point is not available for me. &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2016 08:50:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-to-get-the-centroid-of-a-quot-c-quot-or-quot-u/m-p/543655#M1695</guid>
      <dc:creator>Joo_PinTan</dc:creator>
      <dc:date>2016-09-16T08:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the centroid of a "C" or "U" shape like polygon?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-get-the-centroid-of-a-quot-c-quot-or-quot-u/m-p/543656#M1696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oops... My mistake. Didn't notice the Space where it's posted.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2016 09:12:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-to-get-the-centroid-of-a-quot-c-quot-or-quot-u/m-p/543656#M1696</guid>
      <dc:creator>JayantaPoddar</dc:creator>
      <dc:date>2016-09-16T09:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the centroid of a "C" or "U" shape like polygon?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-get-the-centroid-of-a-quot-c-quot-or-quot-u/m-p/543657#M1697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;did you look for labelpoint or not? it would be in a polygon class or methods section for your api&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2016 10:49:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-to-get-the-centroid-of-a-quot-c-quot-or-quot-u/m-p/543657#M1697</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-09-16T10:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the centroid of a "C" or "U" shape like polygon?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-get-the-centroid-of-a-quot-c-quot-or-quot-u/m-p/543658#M1698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For the Java API, &lt;A href="https://developers.arcgis.com/java/api-reference/com/esri/core/geometry/GeometryEngine.html#getLabelPointForPolygon(com.esri.core.geometry.Polygon,%20com.esri.core.geometry.SpatialReference)"&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;getLabelPointForPolygon&lt;/SPAN&gt; &lt;/A&gt;in the &lt;A href="https://developers.arcgis.com/java/api-reference/com/esri/core/geometry/GeometryEngine.html"&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;GeometryEngine&lt;/SPAN&gt; &lt;/A&gt;class.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2016 15:10:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-to-get-the-centroid-of-a-quot-c-quot-or-quot-u/m-p/543658#M1698</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-09-16T15:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the centroid of a "C" or "U" shape like polygon?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-get-the-centroid-of-a-quot-c-quot-or-quot-u/m-p/543659#M1699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;like I said Joshua... they have to look for labelpoint stuff ... grief &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2016 17:14:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-to-get-the-centroid-of-a-quot-c-quot-or-quot-u/m-p/543659#M1699</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-09-16T17:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the centroid of a "C" or "U" shape like polygon?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-get-the-centroid-of-a-quot-c-quot-or-quot-u/m-p/543660#M1700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;protected&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;boolean&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;determineCentroid&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Geometry polygon&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Point centroid&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;polygon&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getType&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; Geometry&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Type&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;POLYGON&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Point tempCentroid&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;//Get centroid of the polygon&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Envelope env &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Envelope&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; polygon&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;queryEnvelope&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; tempCentroid &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getCenter&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;//If tempCentroid is within the polygon then centroid is valid, else look for nearest vertex&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;GeometryEngine&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;within&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;polygon&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; tempCentroid&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; featureServiceTable&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getSpatialReference&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; centroid&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setXY&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tempCentroid&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getX&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; tempCentroid&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getY&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Proximity2DResult proximity2DResult &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; GeometryEngine&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getNearestCoordinate&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;polygon&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; tempCentroid&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;true&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; centroid&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setXY&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;proximity2DResult&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getCoordinate&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getX&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; proximity2DResult&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getCoordinate&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getY&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;true&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&amp;nbsp; 
&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;false&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I did something as shown above to look for the centroid of a polygon whereby the centre is empty. Although the result it is not really plotted at the "centre" of the polygon but it did solved my problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:32:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-to-get-the-centroid-of-a-quot-c-quot-or-quot-u/m-p/543660#M1700</guid>
      <dc:creator>Joo_PinTan</dc:creator>
      <dc:date>2021-12-11T23:32:07Z</dc:date>
    </item>
  </channel>
</rss>

