<?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 How to query features within attributed radius of a point feature in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/how-to-query-features-within-attributed-radius-of/m-p/1508394#M60416</link>
    <description>&lt;P&gt;This is a fairly broad question, with multiple potential answers. I'm a bit unsure on how to best do what I want. I feel a bit silly for having to ask such a basic question &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have point features in a feature service with a radius attribute. I have polygon features in a different feature service. I would like popups for the points to list features from the other feature service which intersect within the points attributed radius. Ideally, I would be able to click each of the listed intersecting features and zoom to the polygon on the map.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have succesfully written an attribute expression which lists the features as text, but all in the one attribute.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Write a script to return a value to show in the pop-up. 
// For example, get the average of 4 fields:
// Average($feature.SalesQ1, $feature.SalesQ2, $feature.SalesQ3, $feature.SalesQ4)
var portal = Portal('https://www.arcgis.com')

var fields = [
    'name_trading',
    'variety1',
]

var fs = FeatureSetByPortalItem(
    portal,
    '############################',     // FeatureService ID that you want to grab fields from.
    0,                                      // Sublayer index, usually 0.
    fields,                                 // Array of fields to grab from the FeatureService.
    False                                   // Include geometry?
)

var featurelist = [];

var radius = $feature.service_area
var buffer = Buffer($feature, radius, 'kilometers')

var inter = Intersects(fs, buffer);

for (var f in inter) {
    
    var name = f["name_trading"];
    var var1 = f["variety1"];

    Push(featurelist, name+" - "+var1);

}

return featurelist&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've previously written a different function using the following array structure, which I can't work out how to implement in this situation to make each listed feature it's own field. And even if I could, I don't think I can zoom to each feature via a click if I made this display as intended.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var newfields = [
          { alias: $feature.variety1 , value: $feature.var1_perc },
          { alias: $feature.variety2 , value: $feature.var2_perc },
          { alias: $feature.variety3 , value: $feature.var3_perc },
];&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;P&gt;Alternative ideas that I can't quite get my head around implementing right now:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Arcade element in the popup which displays some sort of list. I can &amp;lt;a href&amp;gt; from this, but I don't think I can zoom to features. So might not accomplish what I want still?&lt;/LI&gt;&lt;LI&gt;Click within the point popup maybe, which opens a Near Me tool, inputs the attributed radius as a distance, and return the features within that radius. I just can't quite understand the workflow here.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I missing a more obvious idea? I would appreciate any ideas or directions anyone has to offer.&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jul 2024 05:52:27 GMT</pubDate>
    <dc:creator>BlakeMorrison</dc:creator>
    <dc:date>2024-07-23T05:52:27Z</dc:date>
    <item>
      <title>How to query features within attributed radius of a point feature</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-query-features-within-attributed-radius-of/m-p/1508394#M60416</link>
      <description>&lt;P&gt;This is a fairly broad question, with multiple potential answers. I'm a bit unsure on how to best do what I want. I feel a bit silly for having to ask such a basic question &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have point features in a feature service with a radius attribute. I have polygon features in a different feature service. I would like popups for the points to list features from the other feature service which intersect within the points attributed radius. Ideally, I would be able to click each of the listed intersecting features and zoom to the polygon on the map.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have succesfully written an attribute expression which lists the features as text, but all in the one attribute.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Write a script to return a value to show in the pop-up. 
// For example, get the average of 4 fields:
// Average($feature.SalesQ1, $feature.SalesQ2, $feature.SalesQ3, $feature.SalesQ4)
var portal = Portal('https://www.arcgis.com')

var fields = [
    'name_trading',
    'variety1',
]

var fs = FeatureSetByPortalItem(
    portal,
    '############################',     // FeatureService ID that you want to grab fields from.
    0,                                      // Sublayer index, usually 0.
    fields,                                 // Array of fields to grab from the FeatureService.
    False                                   // Include geometry?
)

var featurelist = [];

var radius = $feature.service_area
var buffer = Buffer($feature, radius, 'kilometers')

var inter = Intersects(fs, buffer);

for (var f in inter) {
    
    var name = f["name_trading"];
    var var1 = f["variety1"];

    Push(featurelist, name+" - "+var1);

}

return featurelist&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've previously written a different function using the following array structure, which I can't work out how to implement in this situation to make each listed feature it's own field. And even if I could, I don't think I can zoom to each feature via a click if I made this display as intended.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var newfields = [
          { alias: $feature.variety1 , value: $feature.var1_perc },
          { alias: $feature.variety2 , value: $feature.var2_perc },
          { alias: $feature.variety3 , value: $feature.var3_perc },
];&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;P&gt;Alternative ideas that I can't quite get my head around implementing right now:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Arcade element in the popup which displays some sort of list. I can &amp;lt;a href&amp;gt; from this, but I don't think I can zoom to features. So might not accomplish what I want still?&lt;/LI&gt;&lt;LI&gt;Click within the point popup maybe, which opens a Near Me tool, inputs the attributed radius as a distance, and return the features within that radius. I just can't quite understand the workflow here.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I missing a more obvious idea? I would appreciate any ideas or directions anyone has to offer.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 05:52:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-query-features-within-attributed-radius-of/m-p/1508394#M60416</guid>
      <dc:creator>BlakeMorrison</dc:creator>
      <dc:date>2024-07-23T05:52:27Z</dc:date>
    </item>
  </channel>
</rss>

