<?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 Arcade expression to list nearby points within pop-up in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-list-nearby-points-within-pop/m-p/1348131#M55796</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a hosted feature layer on AGOL and would like to be able to present a list of the nearby points to any given point.&amp;nbsp;I have found some very helpful info online which I have used to almost get the output I am looking for.&lt;/P&gt;&lt;P&gt;The output in the pop-up only gives some of the points that fall within a 3km buffer within the list, others that clearly area within that distance are not listed.&amp;nbsp;The other issue is the list includes the points themselves.&lt;/P&gt;&lt;P&gt;Example - Point 1 is close to point 2 and point 3, but the pop-up list for point 1 shows point 1 within the list alongside point 2 omitting point 3 entirely.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code I have copied and edited from this online resource -&amp;nbsp;&lt;A href="https://www.esri.com/arcgis-blog/products/arcgis-online/analytics/use-arcade-geometry-functions/" target="_blank"&gt;Use Arcade geometry functions with FeatureSets to provide spatial context (esri.com)&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;SNAPlayer&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;FeatureSetByName&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$map&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"NPP Peatland sites"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&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p; &lt;/SPAN&gt;&lt;SPAN&gt;site_list&lt;/SPAN&gt;&lt;SPAN&gt; += &lt;/SPAN&gt;&lt;SPAN&gt;k&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Site_name&lt;/SPAN&gt;&lt;SPAN&gt; + &lt;/SPAN&gt;&lt;SPAN&gt;TextFormatting&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;NewLine&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;site_list&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The way I am understanding the above code is that I am defining the layer in the map then applying a 3000m buffer to the feature then creating a list of points from the layer that fall within the 3000m buffer.&amp;nbsp;&lt;BR /&gt;Then creating a site list using the site name field as the output.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Any help on this would be appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks,&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Andy&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 10 Nov 2023 06:24:50 GMT</pubDate>
    <dc:creator>AndrewHankinson</dc:creator>
    <dc:date>2023-11-10T06:24:50Z</dc:date>
    <item>
      <title>Arcade expression to list nearby points within pop-up</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-list-nearby-points-within-pop/m-p/1348131#M55796</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a hosted feature layer on AGOL and would like to be able to present a list of the nearby points to any given point.&amp;nbsp;I have found some very helpful info online which I have used to almost get the output I am looking for.&lt;/P&gt;&lt;P&gt;The output in the pop-up only gives some of the points that fall within a 3km buffer within the list, others that clearly area within that distance are not listed.&amp;nbsp;The other issue is the list includes the points themselves.&lt;/P&gt;&lt;P&gt;Example - Point 1 is close to point 2 and point 3, but the pop-up list for point 1 shows point 1 within the list alongside point 2 omitting point 3 entirely.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code I have copied and edited from this online resource -&amp;nbsp;&lt;A href="https://www.esri.com/arcgis-blog/products/arcgis-online/analytics/use-arcade-geometry-functions/" target="_blank"&gt;Use Arcade geometry functions with FeatureSets to provide spatial context (esri.com)&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;SNAPlayer&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;FeatureSetByName&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$map&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"NPP Peatland sites"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;areabuff&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;Buffer&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;3000&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"meters"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;siteswithin&lt;/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N&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The way I am understanding the above code is that I am defining the layer in the map then applying a 3000m buffer to the feature then creating a list of points from the layer that fall within the 3000m buffer.&amp;nbsp;&lt;BR /&gt;Then creating a site list using the site name field as the output.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Any help on this would be appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks,&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Andy&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 10 Nov 2023 06:24:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-list-nearby-points-within-pop/m-p/1348131#M55796</guid>
      <dc:creator>AndrewHankinson</dc:creator>
      <dc:date>2023-11-10T06:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression to list nearby points within pop-up</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-list-nearby-points-within-pop/m-p/1354268#M56119</link>
      <description>&lt;P&gt;I am also interested in this concept - how to use Arcade to check for intersecting (etc.) features within the same service.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2023 19:21:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-list-nearby-points-within-pop/m-p/1354268#M56119</guid>
      <dc:creator>COSPNWGuy</dc:creator>
      <dc:date>2023-11-28T19:21:31Z</dc:date>
    </item>
  </channel>
</rss>

