Hello,
I hope to get some direction on how I can get the list of merged polygons (A+B) that intersect another polygon layer (C).
I have two polygon layer A. Municipalities and B. Regional Districts. I merged A and B into a new FeatureSet in Data Expression using common attributes such as admin type and name of the area.
Then, I want to count how many of these admin areas are affected by a weather event (polygon C), ideally returning all the names & geometry, not just count of intersects so that I can use the returned FeatureSet for further like filters.
-- This is what I did so far. The third variable (fs3) is the one need to be used to define intersect, and has not been used yet.
====================================
// Portal
// Create FeatureSet for points - municipality
var fs1 = FeatureSetByPortalItem(p,'xyz', 0, ['*'], true);
// Create Featureset for lines - regional district
var fs2 = FeatureSetByPortalItem(p,'yyy', 13 ,['*'], true);
var fs3 = Filter(FeatureSetByPortalItem(Portal('
https://arcgis.com/'), 'zzz',1,['*'], true),"ImpactLevel=5");
// Create empty feature array and feat object for output
var features = [];
var feat;
// Iterate fs1
for (var feature in fs1) {
// Create feature with aggregated values
feat = {
'attributes': {
'admin_type': ['Municipality'],
'name':feature['Admin_area_name']
}
};
// Push feature into array
Push(features, feat);
};
for (var feature in fs2) {
// Create feature with aggregated values
feat = {
'attributes': {
'admin_type': ['Regional District'],
'name':feature['admin_area_name']
}
};
// Push feature into array
Push(features, feat);
};
// Create dict for merged output FeatureSet
var out_dict = {
'fields': [
{'name': 'admin_type', 'type': 'esriFieldTypeString'},
{'name': 'name', 'type': 'esriFieldTypeString'}
],
'geometryType': '',
'features': features
};
// Convert dictionary to feature set - mergend A and B
//return FeatureSet(Text(out_dict));
//Intersect the new FeatureSet with fs3 (polygon C)