<?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: Return a &amp;quot;merged&amp;quot;/&amp;quot;dissolved&amp;quot; geometry from a FeatureSet with overlapping features in ArcGIS Arcade Questions</title>
    <link>https://community.esri.com/t5/arcgis-arcade-questions/return-a-quot-merged-quot-quot-dissolved-quot/m-p/1695850#M149</link>
    <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;! This worked perfectly and is a lot cleaner/more stream-lined than my original workflow, I appreciate your help!&lt;/P&gt;</description>
    <pubDate>Mon, 13 Apr 2026 16:26:14 GMT</pubDate>
    <dc:creator>NikyShamblin</dc:creator>
    <dc:date>2026-04-13T16:26:14Z</dc:date>
    <item>
      <title>Return a "merged"/"dissolved" geometry from a FeatureSet with overlapping features</title>
      <link>https://community.esri.com/t5/arcgis-arcade-questions/return-a-quot-merged-quot-quot-dissolved-quot/m-p/1695837#M147</link>
      <description>&lt;P&gt;I currently have an Arcade expression (see code snippet below) that involves a karst layer and an area of interest (aoi). The expression loops through each feature of the karst layer and sums the resulting area (as an acreage) of the karst intersection with the aoi and converts that value to a percentage based on the acreage of the aoi.&lt;/P&gt;&lt;P&gt;The issue I'm running into is that the karst layer has overlapping features, which can result in area percentages over 100%.&lt;/P&gt;&lt;P&gt;I've attempted to create one geometry based on the karst features that intersect the area of interest, but haven't been successful. In essence, I'm trying to "dissolve" the karst features (within the same featureset) so I can intersect the dissolved geometry with my area of interest.&lt;/P&gt;&lt;P&gt;Any help here would be appreciated, thanks!&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;//Define Karst FeatureSet
var karst = FeatureSetByPortalItem(Portal('https://www.arcgis.com'),'689167928f6e49f689d0f08b31ad8c47',0)

//Create FeatureSet of Karst features that intersect the aoi ($feature)
var karst_aoi = Intersects(karst, $feature)

//Calculate acreage of aoi
var aoi_acre = AreaGeodetic($feature, 'acres')

//Create empty FeatureSet with percentage and karst type fields  
var new_f_karst = {fields:[        
        {'name':'karst_percent','type': 'esriFieldTypeDouble'},
        {'name':'karst_type','type': 'esriFieldTypeString'}],
        'geometryType': '',
        'features':[]
        }

//Loop through each feature in karst_aoi FeatureSet, calculate acreage, push to created FeatureSet (new_f_karst)
for (var c in karst_aoi){
  var karst_percent = ((AreaGeodetic(Intersection(c, $feature), 'acres'))/aoi_acre)*100
  var new_c = {'attributes': [{'karst_percent': karst_percent},{'karst_type': 'Karst'}]
                }
  Push(new_f_karst.features, new_c)}

//Group records by the karst type, and give resulting karst acreage sum
var karstStats = GroupBy(FeatureSet(Text(new_f_karst)), { name: 'karst_type', expression: 'karst_type'}, { name: 'karst_percent', expression: 'karst_percent', statistic: 'SUM' });

//Create final_percent varible with summed acreages
var final_percent = 0;
for (var k in karstStats){
  final_percent += k.karst_percent;
}

//Give final percentage value
var final_text = "Approximately " + final_percent + "% of the site contains karst.";

return { type: "text", text: final_text }&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 13 Apr 2026 15:29:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-arcade-questions/return-a-quot-merged-quot-quot-dissolved-quot/m-p/1695837#M147</guid>
      <dc:creator>NikyShamblin</dc:creator>
      <dc:date>2026-04-13T15:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: Return a "merged"/"dissolved" geometry from a FeatureSet with overlapping features</title>
      <link>https://community.esri.com/t5/arcgis-arcade-questions/return-a-quot-merged-quot-quot-dissolved-quot/m-p/1695847#M148</link>
      <description>&lt;P&gt;You can use the Union function to combine all the intersecting karst features into a single feature, which you'll intersect with your original feature to get the area calculations.&lt;/P&gt;&lt;P&gt;Give this a try. I haven't tested it out, however...&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//Define Karst FeatureSet
var karst = FeatureSetByPortalItem(
  Portal("https://www.arcgis.com"),
  "689167928f6e49f689d0f08b31ad8c47",
  0
);

//Create FeatureSet of Karst features that intersect the aoi ($feature)
var karst_aoi = Intersects(karst, $feature);

//Calculate acreage of aoi
var aoi_acre = AreaGeodetic($feature, "acres");

//Create an array of the karst features to use in the Union function since it doesn't accept a FeatureSet
var karst_array = [];
for (var c in karst_aoi) {
  Push(karst_array, c);
}
var karst_feature = Union(karst_array);

var karst_percent = AreaGeodetic(Intersection(karst_feature, $feature), "acres") / aoi_acre * 100;

var final_text = `Approximately ${karst_percent}% of the site contains karst.`;

return {
  type: "text", 
  text: final_text
};&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 13 Apr 2026 16:11:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-arcade-questions/return-a-quot-merged-quot-quot-dissolved-quot/m-p/1695847#M148</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2026-04-13T16:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: Return a "merged"/"dissolved" geometry from a FeatureSet with overlapping features</title>
      <link>https://community.esri.com/t5/arcgis-arcade-questions/return-a-quot-merged-quot-quot-dissolved-quot/m-p/1695850#M149</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;! This worked perfectly and is a lot cleaner/more stream-lined than my original workflow, I appreciate your help!&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2026 16:26:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-arcade-questions/return-a-quot-merged-quot-quot-dissolved-quot/m-p/1695850#M149</guid>
      <dc:creator>NikyShamblin</dc:creator>
      <dc:date>2026-04-13T16:26:14Z</dc:date>
    </item>
  </channel>
</rss>

