<?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: Get polygon vertexes for attribute rules in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/get-polygon-vertexes-for-attribute-rules/m-p/1180926#M55935</link>
    <description>&lt;P&gt;Documentation for polygons and polylines:&amp;nbsp;&lt;A href="https://developers.arcgis.com/arcade/guide/types/#polyline" target="_blank" rel="noopener"&gt;Type System | ArcGIS Arcade | ArcGIS Developer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Polygons have a &lt;STRONG&gt;rings&lt;/STRONG&gt; attribute, polylines have a &lt;STRONG&gt;paths&lt;/STRONG&gt; attribute. These are three-dimensional lists of numbers, representing point coordinates of multiple line segments / rings.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// get the number of vertices in a polygon
var rings = Geometry($feature).rings
var vertex_count = 0
for(var i in rings) {
    vertex_count += Count(rings[i])
    // for polygons, the first and last point of a ring are the same, so we have to subract 1
    vertex_count -= 1
}
return vertex_count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// get number of points on vertices
var rings = Geometry($feature).rings
var point_fc = FeatureSetByName($datastore, "TestPoints", ["OBJECTID"], true)
var points_on_vertices = 0
for(var i in rings) {
    for(var j in rings[i]) {
        var vertex = rings[i][j]
        points_on_vertices += Count(Intersects(vertex, point_fc))
    }
}
return points_on_vertices&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Jun 2022 07:21:52 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2022-06-08T07:21:52Z</dc:date>
    <item>
      <title>Get polygon vertexes for attribute rules</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/get-polygon-vertexes-for-attribute-rules/m-p/1180581#M55886</link>
      <description>&lt;P&gt;I would like to do some checks on a new created polygon using attribute rules.&lt;/P&gt;&lt;P&gt;For example count the vertexes or check if they exists as points in a different layer.&lt;/P&gt;&lt;P&gt;I could not find a way to do it.&lt;/P&gt;&lt;P&gt;Possible way is to convert the feature geometry to JSON.&lt;/P&gt;&lt;P&gt;I found FromJSON but not ToJSON. There are many functions to translate from JSON to feature but not the other way around.&lt;/P&gt;&lt;P&gt;Is there any way to do it?&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 13:37:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/get-polygon-vertexes-for-attribute-rules/m-p/1180581#M55886</guid>
      <dc:creator>mody_buchbinder</dc:creator>
      <dc:date>2022-06-07T13:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: Get polygon vertexes for attribute rules</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/get-polygon-vertexes-for-attribute-rules/m-p/1180926#M55935</link>
      <description>&lt;P&gt;Documentation for polygons and polylines:&amp;nbsp;&lt;A href="https://developers.arcgis.com/arcade/guide/types/#polyline" target="_blank" rel="noopener"&gt;Type System | ArcGIS Arcade | ArcGIS Developer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Polygons have a &lt;STRONG&gt;rings&lt;/STRONG&gt; attribute, polylines have a &lt;STRONG&gt;paths&lt;/STRONG&gt; attribute. These are three-dimensional lists of numbers, representing point coordinates of multiple line segments / rings.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// get the number of vertices in a polygon
var rings = Geometry($feature).rings
var vertex_count = 0
for(var i in rings) {
    vertex_count += Count(rings[i])
    // for polygons, the first and last point of a ring are the same, so we have to subract 1
    vertex_count -= 1
}
return vertex_count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// get number of points on vertices
var rings = Geometry($feature).rings
var point_fc = FeatureSetByName($datastore, "TestPoints", ["OBJECTID"], true)
var points_on_vertices = 0
for(var i in rings) {
    for(var j in rings[i]) {
        var vertex = rings[i][j]
        points_on_vertices += Count(Intersects(vertex, point_fc))
    }
}
return points_on_vertices&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 07:21:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/get-polygon-vertexes-for-attribute-rules/m-p/1180926#M55935</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-06-08T07:21:52Z</dc:date>
    </item>
  </channel>
</rss>

