<?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: Arcade Pop Ups and Lists for features that intersect or are in close proximity in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-pop-ups-and-lists-for-features-that/m-p/1265129#M50735</link>
    <description>&lt;P&gt;Hi Johannes,&amp;nbsp;&lt;/P&gt;&lt;P&gt;You mentioned towards the end of the response that its possible to&lt;SPAN&gt;&amp;nbsp;modify the expression to fill a featureset with all pairs of overlapping projects and feed that featureset into a dashboard widget.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I was just asking how to modify the code to create that project overlap feature class and table.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Mar 2023 19:46:35 GMT</pubDate>
    <dc:creator>ChrisSpadi</dc:creator>
    <dc:date>2023-03-07T19:46:35Z</dc:date>
    <item>
      <title>Arcade Pop Ups and Lists for features that intersect or are in close proximity</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-pop-ups-and-lists-for-features-that/m-p/1259173#M50421</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;I was wondering if something like this could be achievable with Arcade?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChrisSpadi_0-1676590495032.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/63060i8CFC312EF0013666/image-size/large?v=v2&amp;amp;px=999" role="button" title="ChrisSpadi_0-1676590495032.png" alt="ChrisSpadi_0-1676590495032.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 23:36:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-pop-ups-and-lists-for-features-that/m-p/1259173#M50421</guid>
      <dc:creator>ChrisSpadi</dc:creator>
      <dc:date>2023-02-16T23:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Pop Ups and Lists for features that intersect or are in close proximity</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-pop-ups-and-lists-for-features-that/m-p/1259178#M50422</link>
      <description>&lt;P&gt;Absolutely! Take a look at the &lt;STRONG&gt;Intersects &lt;/STRONG&gt;function, as it's what you'll need to identify features that touch one another. For the proximity part, you can just buffer the input feature 250ft, and use the &lt;STRONG&gt;Distance &lt;/STRONG&gt;function to get the distance between.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2023 00:15:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-pop-ups-and-lists-for-features-that/m-p/1259178#M50422</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2023-02-17T00:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Pop Ups and Lists for features that intersect or are in close proximity</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-pop-ups-and-lists-for-features-that/m-p/1260387#M50493</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;I have a map that has multiple feature classes/services. They are project locations for different groups with basic attribute information like Project ID, Name, Type, Description, Project Manager, Estimated Begin and End date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was originally thinking of using the intersect and proximity functions in Arcade to create a pop up for projects that intersect or come within a certain proximity of each other and have overlapping dates.&lt;/P&gt;&lt;P&gt;Now thinking about it (it would be too busy with too many pop ups), it would probably be better to have a list generated that calls out projects that overlap or come within close proximity of each other and have overlapping dates instead of single pop ups&amp;nbsp;for the whole map area.&lt;/P&gt;&lt;P&gt;Is this possible with just Arcade? Are there any existing similar examples of this? And how would one go about this?&lt;/P&gt;&lt;P&gt;Or would this need to be a web app with custom Java/Python scripting?&lt;/P&gt;&lt;P&gt;Thanks for any insight.&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can list the overlapping projects in a popup:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// load all project layers (including this one!)
var other_project_fcs = [
    FeaturesetByName($map, "TestPoints"),
    FeaturesetByName($map, "TestLines"),
    FeaturesetByName($map, "TestPolygons"),
]
// buffer your project geometry
var project_buffer = Buffer($feature, 250, "feet")

var other_projects = []
// iterate over the project layers
for(var i in other_project_fcs) {
    // find all projects intersecting the current project (buffered)
    var nearby_projects = Intersects(project_buffer, other_project_fcs[i])
    // iterate over those projects
    for(var project in nearby_projects) {
        // skip if the intersecting project is the current $feature
        if($feature.ProjectID == project.ProjectID) { continue }
        // get start and end dates
        var start1 = $feature.BeginDate
        var end1 = $feature.EndDate
        var start2 = project.BeginDate
        var end2 = project.EndDate
        // skip if there is no time overlap
        if(start1 &amp;gt; end2 || start2 &amp;gt; end1) { continue }
        // calculate the time overlap
        var overlap_start = Date(Max([Number(start1), Number(start2)]))
        var overlap_end = Date(Min([Number(end1), Number(end2)]))
        var overlap = DateDiff(overlap_end, overlap_start, "days") + 1
        // describe the overlapping project
        var dist = Round(Distance($feature, project, "feet"), 0)
        var runtime = Text(start2, "MM/DD/Y") + " - " + Text(end2, "MM/DD/Y")
        var project_text = [
            "Project: " + project.Project,
            "Contact: " + project.Contact,
            "Distance: " + dist + " feet",
            "Runstime: " + runtime,
            "Overlap: " + overlap + " days"
            ]
        // append the desription to the array
        Push(other_projects, Concatenate(project_text, "\n"))
    }
}
// concatenate the descriptions and return
return Concatenate(other_projects, "\n\n")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1677057055189.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/63382i0530F8A12E691343/image-size/large?v=v2&amp;amp;px=999" role="button" title="JohannesLindner_0-1677057055189.png" alt="JohannesLindner_0-1677057055189.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_1-1677057080213.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/63383iE712D9C9CF3EC642/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_1-1677057080213.png" alt="JohannesLindner_1-1677057080213.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_2-1677057096407.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/63384i8FD9F9401AA69835/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_2-1677057096407.png" alt="JohannesLindner_2-1677057096407.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_3-1677057110497.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/63385iF11FF738EF7E5DA9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_3-1677057110497.png" alt="JohannesLindner_3-1677057110497.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_5-1677057205806.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/63387i4AD707BB29913AD9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_5-1677057205806.png" alt="JohannesLindner_5-1677057205806.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can modify the expression to fill a featureset with all pairs of overlapping projects and feed that featureset into a list widget in a Dashboard or Experience, no custom javascript neccessary.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 09:18:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-pop-ups-and-lists-for-features-that/m-p/1260387#M50493</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-02-22T09:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Pop Ups and Lists for features that intersect or are in close proximity</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-pop-ups-and-lists-for-features-that/m-p/1264608#M50699</link>
      <description>&lt;P&gt;Thanks Johannes. This is awesome. How would I generate the overlap feature and table that met the spatial and date conditions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Was curious if a field like contact existed with an email, would it be possible to generate a notification to both project contacts if the conditions of location and dates is met?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 17:27:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-pop-ups-and-lists-for-features-that/m-p/1264608#M50699</guid>
      <dc:creator>ChrisSpadi</dc:creator>
      <dc:date>2023-03-06T17:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Pop Ups and Lists for features that intersect or are in close proximity</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-pop-ups-and-lists-for-features-that/m-p/1264691#M50706</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;How would I generate the overlap feature and table that met the spatial and date conditions?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Not sure what you're asking. Can you clarify?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;if a field like contact existed with an email, would it be possible to generate a notification to both project contacts if the conditions of location and dates is met?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Probably, but not with Arcade. You can whip up a Python script that sends the mails. I think you could execute the script via a webhook when a new project is inserted, but I don't know anything about that.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 19:28:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-pop-ups-and-lists-for-features-that/m-p/1264691#M50706</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-03-06T19:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Pop Ups and Lists for features that intersect or are in close proximity</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-pop-ups-and-lists-for-features-that/m-p/1265129#M50735</link>
      <description>&lt;P&gt;Hi Johannes,&amp;nbsp;&lt;/P&gt;&lt;P&gt;You mentioned towards the end of the response that its possible to&lt;SPAN&gt;&amp;nbsp;modify the expression to fill a featureset with all pairs of overlapping projects and feed that featureset into a dashboard widget.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I was just asking how to modify the code to create that project overlap feature class and table.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 19:46:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-pop-ups-and-lists-for-features-that/m-p/1265129#M50735</guid>
      <dc:creator>ChrisSpadi</dc:creator>
      <dc:date>2023-03-07T19:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Pop Ups and Lists for features that intersect or are in close proximity</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-pop-ups-and-lists-for-features-that/m-p/1265943#M50779</link>
      <description>&lt;P&gt;Ah.&lt;/P&gt;&lt;P&gt;You can use this expression in a dashboard list/table:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// load all project layers (change to you layer ids)
var project_layers = [
  FeaturesetByPortalItem(Portal("https://arcgis.com"), "b0d335151aad48a5883326b9aed69cdd", 0),
  FeaturesetByPortalItem(Portal("https://arcgis.com"), "b0d335151aad48a5883326b9aed69cdd", 1),
  FeaturesetByPortalItem(Portal("https://arcgis.com"), "b0d335151aad48a5883326b9aed69cdd", 2),
]

// read the project data (change to yoour fields)
var projects = []
for(var i in project_layers) {
  for(var p in project_layers[i]) {
    var project = {
      name: p.TextField1,
      contact: p.TextField2,
      start: p.DateField1,
      end: p.DateField2,
      geo: Geometry(p),
      b_geo: Buffer(p, 250, "feet"),
    }
    Push(projects, project)
  }
}
// create the output dictionary
var out_dict = {
  fields: [
    {name: "Project1", type: "esriFieldTypeString"},
    {name: "Contact1", type: "esriFieldTypeString"},
    {name: "Runtime1", type: "esriFieldTypeString"},
    {name: "Project2", type: "esriFieldTypeString"},
    {name: "Contact2", type: "esriFieldTypeString"},
    {name: "Runtime2", type: "esriFieldTypeString"},
    {name: "Distance", type: "esriFieldTypeDouble"},
    {name: "Overlap", type: "esriFieldTypeInteger"},
  ],
  geometryType: "",
  features: []
}

// find overlapping projects
for(var p in projects) {
  for(var q = p + 1; q &amp;lt; Count(projects); q++) {
    var p1 = projects[p]
    var p2 = projects[q]
    // skip if no spatial overlap
    if(!Intersects(p1.b_geo, p2.geo)) { continue }
    // skip  if no temporal overlap
    if(p1.start &amp;gt; p2.end || p2.start &amp;gt; p1.end) { continue }
    // calculate temporal overlap
    var overlap_start = Date(Max([Number(p1.start), Number(p2.start)]))
    var overlap_end = Date(Min([Number(p1.end), Number(p2.end)]))
    var overlap = DateDiff(overlap_end, overlap_start, "days") + 1
    // append the project pair to output
    var pair = {
      Project1: p1.name,
      Contact1: p1.contact,
      Runtime1: Text(p1.start, "MM/DD/Y") + " - " + Text(p1.end, "MM/DD/Y"),
      Project2: p2.name,
      Contact2: p2.contact,
      Runtime2: Text(p2.start, "MM/DD/Y") + " - " + Text(p2.end, "MM/DD/Y"),
      Distance: Distance(p1.geo, p2.geo),
      Overlap: overlap,
    }
    Push(out_dict.features, {attributes: pair})
  }
}

// convert to Featrueset and return
return Featureset(Text(out_dict))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the expression set up like this, it will return one entry for each pair of overlapping projects:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_3-1678366425415.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/64804iE12E6AC9092788AC/image-size/large?v=v2&amp;amp;px=999" role="button" title="JohannesLindner_3-1678366425415.png" alt="JohannesLindner_3-1678366425415.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can replace line 41 with this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;  for(var q in projects) {
    if(p == q) { continue }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then you will get two entries for each pair of overlapping projects:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_2-1678366345548.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/64802i7B9418A956DDC5B2/image-size/large?v=v2&amp;amp;px=999" role="button" title="JohannesLindner_2-1678366345548.png" alt="JohannesLindner_2-1678366345548.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 12:56:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-pop-ups-and-lists-for-features-that/m-p/1265943#M50779</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-03-09T12:56:59Z</dc:date>
    </item>
  </channel>
</rss>

