<?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: Finding Intersection of two polygons in popup in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/finding-intersection-of-two-polygons-in-popup/m-p/1102006#M74800</link>
    <description>&lt;P&gt;Ah yes, I missed the $feature in the Intersects function. Should have tested it, sorry.&lt;/P&gt;&lt;P&gt;I edited my original reply for future reference.&lt;/P&gt;</description>
    <pubDate>Mon, 27 Sep 2021 05:48:42 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2021-09-27T05:48:42Z</dc:date>
    <item>
      <title>Finding Intersection of two polygons in popup</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/finding-intersection-of-two-polygons-in-popup/m-p/1101476#M74765</link>
      <description>&lt;P&gt;I am attempting to calculate the area of intersection for two feature layers in a popup field. The layer I am building the popup for is called Parcels and the other layer is Impact Area. This is my best guess at the expression, but it is returning blank.&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;expression: "AreaGeodetic(Intersection($feature, FeatureSetByName($map, 'Impact Area')), 'acres')"&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;Any suggestions?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Sep 2021 21:36:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/finding-intersection-of-two-polygons-in-popup/m-p/1101476#M74765</guid>
      <dc:creator>JeffreyThompson1</dc:creator>
      <dc:date>2021-09-23T21:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Intersection of two polygons in popup</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/finding-intersection-of-two-polygons-in-popup/m-p/1101561#M74769</link>
      <description>&lt;P&gt;&lt;A href="https://developers.arcgis.com/arcade/function-reference/geometry_functions/#intersection" target="_blank" rel="noopener"&gt;Intersection&lt;/A&gt; takes 2 geometries as input, you use a feature set as second argument.&lt;/P&gt;&lt;P&gt;Assuming that a parcel can intersect multiple impact areas and that impact areas do not overlap:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var impact_areas = Intersects($feature, FeatureSetByName($map, 'Impact Area'))
var impacted_area = 0
for(var ia in impact_areas) {
  impacted_area += AreaGeodetic(Intersection($feature, ia), 'acres')
return impacted_area&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Sep 2021 05:47:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/finding-intersection-of-two-polygons-in-popup/m-p/1101561#M74769</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-09-27T05:47:20Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Intersection of two polygons in popup</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/finding-intersection-of-two-polygons-in-popup/m-p/1101624#M74775</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&lt;/P&gt;&lt;P&gt;To clarify, I have one impact area on my map which intersects with multiple parcels that do not overlap with each other. I am looking for the area in a single parcel that falls within the impact area. Based on your suggestion I have tried the following code. It also returns blank with this error: SyntaxError: Unexpected token o in JSON at position 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;expression: "AreaGeodetic(Intersection($feature, Geometry(FeatureSetByName($map, 'Impact Area', ['*'], true))), 'acres')"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also attempted your solution and it also returned blank with a Missing Parameters error.&lt;/P&gt;&lt;P&gt;What is the best way to select the geometry from another map layer to use in this function?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Sep 2021 14:40:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/finding-intersection-of-two-polygons-in-popup/m-p/1101624#M74775</guid>
      <dc:creator>JeffreyThompson1</dc:creator>
      <dc:date>2021-09-24T14:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Intersection of two polygons in popup</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/finding-intersection-of-two-polygons-in-popup/m-p/1101679#M74777</link>
      <description>&lt;P&gt;I came up with a solution. (For a single impact area shapefile)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;expression: "AreaGeodetic(Intersection($feature, First(FeatureSetByName($map, 'Impact Area', ['*'], true))), 'acres')"&lt;/LI-CODE&gt;&lt;P&gt;I found out I also need to handle multiple impact area shapefiles and corrected a couple errors in the original reply to get my final solution.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var impact_areas = Intersects($feature, FeatureSetByName($map, 'Impact Area', ['*'], true))
var impacted_area = 0
for(var ia in impact_areas) {
    impacted_area += AreaGeodetic(Intersection($feature, ia), 'acres')
}
return impacted_area&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp; I wouldn't have got there without you.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Sep 2021 16:56:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/finding-intersection-of-two-polygons-in-popup/m-p/1101679#M74777</guid>
      <dc:creator>JeffreyThompson1</dc:creator>
      <dc:date>2021-09-24T16:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Intersection of two polygons in popup</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/finding-intersection-of-two-polygons-in-popup/m-p/1102006#M74800</link>
      <description>&lt;P&gt;Ah yes, I missed the $feature in the Intersects function. Should have tested it, sorry.&lt;/P&gt;&lt;P&gt;I edited my original reply for future reference.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Sep 2021 05:48:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/finding-intersection-of-two-polygons-in-popup/m-p/1102006#M74800</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-09-27T05:48:42Z</dc:date>
    </item>
  </channel>
</rss>

