<?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 Working with holes of a polygon in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/working-with-holes-of-a-polygon/m-p/868871#M5051</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a couple of questions regarding to working with parts of polygons.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How can I know if a part is a hole?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At now there is no easy way to determine if a polygon's part is a hole. Turning the part into polygon and checking the sign of its area is the only way. If value of the &lt;A href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/index.html#topic8474.html" rel="nofollow noopener noreferrer" target="_blank"&gt;Area&lt;/A&gt;&amp;nbsp;property is a positive number we deal with exterior ring, if negative – with a hole. But it's not obvious.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would be great if there will be some method to check orientation of a part in the Pro SDK. Since a part of a polygon is just &lt;A href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/index.html#topic8740.html" rel="nofollow noopener noreferrer" target="_blank"&gt;ReadOnlySegmentCollection&lt;/A&gt;&amp;nbsp;(which is common for polylines and polygons) maybe the more appropriate place for such method is &lt;A href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/index.html#topic8196.html" rel="nofollow noopener noreferrer" target="_blank"&gt;GeometryEngine&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How can I get all holes of the specific exterior ring?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At now the only way to get all holes of the exetrior part is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; partsAsPolygons &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; polygon&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Parts&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Select&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;p &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; PolygonBuilder&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;CreatePolygon&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;p&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="keyword token"&gt;foreach&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; exteriorPart &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; partsAsPolygons&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Where&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;p &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; p&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Area &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&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;var&lt;/SPAN&gt; interiorParts &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; partsAsPolygons&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Where&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;p &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; p&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Area &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; GeometryEngine&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Contains&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;exteriorPart&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; p&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;&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So we need to use &lt;A href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/index.html#topic8210.html" rel="nofollow noopener noreferrer" target="_blank"&gt;GeometryEngine.Contains&lt;/A&gt; method to find all parts with negative area inside some part with positive area. Awful workaround. Hope you will add easy way to get interior parts of an exterior one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 10:49:23 GMT</pubDate>
    <dc:creator>MaxMax2</dc:creator>
    <dc:date>2021-12-12T10:49:23Z</dc:date>
    <item>
      <title>Working with holes of a polygon</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/working-with-holes-of-a-polygon/m-p/868871#M5051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a couple of questions regarding to working with parts of polygons.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How can I know if a part is a hole?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At now there is no easy way to determine if a polygon's part is a hole. Turning the part into polygon and checking the sign of its area is the only way. If value of the &lt;A href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/index.html#topic8474.html" rel="nofollow noopener noreferrer" target="_blank"&gt;Area&lt;/A&gt;&amp;nbsp;property is a positive number we deal with exterior ring, if negative – with a hole. But it's not obvious.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would be great if there will be some method to check orientation of a part in the Pro SDK. Since a part of a polygon is just &lt;A href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/index.html#topic8740.html" rel="nofollow noopener noreferrer" target="_blank"&gt;ReadOnlySegmentCollection&lt;/A&gt;&amp;nbsp;(which is common for polylines and polygons) maybe the more appropriate place for such method is &lt;A href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/index.html#topic8196.html" rel="nofollow noopener noreferrer" target="_blank"&gt;GeometryEngine&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How can I get all holes of the specific exterior ring?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At now the only way to get all holes of the exetrior part is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; partsAsPolygons &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; polygon&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Parts&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Select&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;p &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; PolygonBuilder&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;CreatePolygon&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;p&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="keyword token"&gt;foreach&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; exteriorPart &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; partsAsPolygons&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Where&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;p &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; p&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Area &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&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;var&lt;/SPAN&gt; interiorParts &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; partsAsPolygons&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Where&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;p &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; p&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Area &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; GeometryEngine&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Contains&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;exteriorPart&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; p&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;&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So we need to use &lt;A href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/index.html#topic8210.html" rel="nofollow noopener noreferrer" target="_blank"&gt;GeometryEngine.Contains&lt;/A&gt; method to find all parts with negative area inside some part with positive area. Awful workaround. Hope you will add easy way to get interior parts of an exterior one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:49:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/working-with-holes-of-a-polygon/m-p/868871#M5051</guid>
      <dc:creator>MaxMax2</dc:creator>
      <dc:date>2021-12-12T10:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: Working with holes of a polygon</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/working-with-holes-of-a-polygon/m-p/868872#M5052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please do take a look at the following code snippet&amp;nbsp;&lt;A class="link-titled" href="https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Geometry#determine-if-a-polygon-ring-is-an-outer-ring-or-an-inner-ring" title="https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Geometry#determine-if-a-polygon-ring-is-an-outer-ring-or-an-inner-ring"&gt;ProSnippets Geometry · Esri/arcgis-pro-sdk Wiki · GitHub&lt;/A&gt;&amp;nbsp;to determine if we are dealing with an interior (hole) or exterior (boundary) ring.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 19:47:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/working-with-holes-of-a-polygon/m-p/868872#M5052</guid>
      <dc:creator>ThomasEmge</dc:creator>
      <dc:date>2017-03-06T19:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: Working with holes of a polygon</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/working-with-holes-of-a-polygon/m-p/868873#M5053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for reply. Yes, checking the sign of a polygon's area is a way to determine orientation of a ring. In my first post I mentioned this way. The way you've suggested is &lt;SPAN&gt;more efficient in terms of performance than checking of &lt;A href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/index.html#topic8474.html"&gt;Area&lt;/A&gt; property. But I really don't understand why you are not going to turn this snippet&amp;nbsp;into some method like &lt;STRONG&gt;GeometryUtils.GetOrientation&lt;/STRONG&gt;.&amp;nbsp;&lt;/SPAN&gt;Also suggested code is more verbose than checking of the &lt;A href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/index.html#topic8474.html"&gt;Area&lt;/A&gt; property value so I am surprised even more that you force developers to use this snippet for such common task as checking of a ring's orienation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Mar 2017 12:36:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/working-with-holes-of-a-polygon/m-p/868873#M5053</guid>
      <dc:creator>MaxMax2</dc:creator>
      <dc:date>2017-03-07T12:36:30Z</dc:date>
    </item>
  </channel>
</rss>

