<?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>idea Arcade docs: Working with vertices in ArcGIS Pro Ideas</title>
    <link>https://community.esri.com/t5/arcgis-pro-ideas/arcade-docs-working-with-vertices/idi-p/1152038</link>
    <description>&lt;P&gt;&lt;BR /&gt;Could Esri add a section to the docs that explains how to work with vertices in Arcade?&lt;/P&gt;&lt;P&gt;For example, to loop through polyline vertices and &lt;STRONG&gt;read&lt;/STRONG&gt; them, do the following:&lt;/P&gt;&lt;PRE&gt;var geo = Geometry($feature);&lt;BR /&gt;for (var part in geo.paths) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; var line_part = geo.paths[part]&lt;BR /&gt;&lt;SPAN class=""&gt;    for&lt;/SPAN&gt; &lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; &lt;SPAN class=""&gt;i&lt;/SPAN&gt; &lt;SPAN class=""&gt;in&lt;/SPAN&gt; &lt;SPAN class=""&gt;line_part&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt; &lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;To loop through polyline vertices and &lt;STRONG&gt;modify&lt;/STRONG&gt; them, do the following:&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#000000"&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; &lt;SPAN class=""&gt;geo&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt;  &lt;SPAN class=""&gt;Dictionary&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;Text&lt;/SPAN&gt;&lt;SPAN class=""&gt;(Geometry($feature)&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;;&lt;/SPAN&gt;
&lt;SPAN class=""&gt;var&lt;/SPAN&gt; &lt;SPAN class=""&gt;paths&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;geo&lt;/SPAN&gt;&lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;'paths'&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt;&lt;SPAN class=""&gt;;&lt;/SPAN&gt;
&lt;SPAN class=""&gt;for&lt;/SPAN&gt; &lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; &lt;SPAN class=""&gt;path_idx&lt;/SPAN&gt; &lt;SPAN class=""&gt;in&lt;/SPAN&gt; &lt;SPAN class=""&gt;paths&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;
    &lt;SPAN class=""&gt;for&lt;/SPAN&gt; &lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; &lt;SPAN class=""&gt;vert_idx&lt;/SPAN&gt; &lt;SPAN class=""&gt;in&lt;/SPAN&gt; &lt;SPAN class=""&gt;paths&lt;/SPAN&gt;&lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;path_idx&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt;&lt;SPAN class=""&gt;){&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;Explanation: &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Geometries are immutable, so we can't modify them directly. But if we convert them to a dictionary, then we can modify the entries in the dictionary, and then use that dictionary to create a new geometry.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As far as I know, there isn't anything in the docs that explains how to work with individual vertices by looping through geometries. Sure, there are samples in the GitHub repo, and they're definitely useful. But it seems like a thorough explanation in the docs would be a big help to people who are learning this stuff from scratch.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Related post:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-pro-questions/arcade-get-paths-array-from-feature-why-so-much/m-p/1151070" target="_self"&gt;Arcade: Get paths array from feature&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Oct 2022 15:59:32 GMT</pubDate>
    <dc:creator>Bud</dc:creator>
    <dc:date>2022-10-27T15:59:32Z</dc:date>
    <item>
      <title>Arcade docs: Working with vertices</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/arcade-docs-working-with-vertices/idi-p/1152038</link>
      <description>&lt;P&gt;&lt;BR /&gt;Could Esri add a section to the docs that explains how to work with vertices in Arcade?&lt;/P&gt;&lt;P&gt;For example, to loop through polyline vertices and &lt;STRONG&gt;read&lt;/STRONG&gt; them, do the following:&lt;/P&gt;&lt;PRE&gt;var geo = Geometry($feature);&lt;BR /&gt;for (var part in geo.paths) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; var line_part = geo.paths[part]&lt;BR /&gt;&lt;SPAN class=""&gt;    for&lt;/SPAN&gt; &lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; &lt;SPAN class=""&gt;i&lt;/SPAN&gt; &lt;SPAN class=""&gt;in&lt;/SPAN&gt; &lt;SPAN class=""&gt;line_part&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt; &lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;To loop through polyline vertices and &lt;STRONG&gt;modify&lt;/STRONG&gt; them, do the following:&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#000000"&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; &lt;SPAN class=""&gt;geo&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt;  &lt;SPAN class=""&gt;Dictionary&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;Text&lt;/SPAN&gt;&lt;SPAN class=""&gt;(Geometry($feature)&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;;&lt;/SPAN&gt;
&lt;SPAN class=""&gt;var&lt;/SPAN&gt; &lt;SPAN class=""&gt;paths&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;geo&lt;/SPAN&gt;&lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;'paths'&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt;&lt;SPAN class=""&gt;;&lt;/SPAN&gt;
&lt;SPAN class=""&gt;for&lt;/SPAN&gt; &lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; &lt;SPAN class=""&gt;path_idx&lt;/SPAN&gt; &lt;SPAN class=""&gt;in&lt;/SPAN&gt; &lt;SPAN class=""&gt;paths&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;
    &lt;SPAN class=""&gt;for&lt;/SPAN&gt; &lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; &lt;SPAN class=""&gt;vert_idx&lt;/SPAN&gt; &lt;SPAN class=""&gt;in&lt;/SPAN&gt; &lt;SPAN class=""&gt;paths&lt;/SPAN&gt;&lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;path_idx&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt;&lt;SPAN class=""&gt;){&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;Explanation: &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Geometries are immutable, so we can't modify them directly. But if we convert them to a dictionary, then we can modify the entries in the dictionary, and then use that dictionary to create a new geometry.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As far as I know, there isn't anything in the docs that explains how to work with individual vertices by looping through geometries. Sure, there are samples in the GitHub repo, and they're definitely useful. But it seems like a thorough explanation in the docs would be a big help to people who are learning this stuff from scratch.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Related post:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-pro-questions/arcade-get-paths-array-from-feature-why-so-much/m-p/1151070" target="_self"&gt;Arcade: Get paths array from feature&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2022 15:59:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/arcade-docs-working-with-vertices/idi-p/1152038</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2022-10-27T15:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade docs: Working with vertices</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/arcade-docs-working-with-vertices/idc-p/1352897#M27204</link>
      <description>&lt;P&gt;Has there been any movement on this? It seems like it's necessary and should be under consideration.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2023 08:57:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/arcade-docs-working-with-vertices/idc-p/1352897#M27204</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2023-11-23T08:57:28Z</dc:date>
    </item>
  </channel>
</rss>

