HOW TO
In ArcGIS Dashboards, Arcade expressions can efficiently calculate and display the count of point features within polygon features using the Indicator element. This method enhances spatial analysis and streamlines the workflow without the need for complex data processing and is demonstrated in this article. The dashboard below shows the point and polygon features.
var p = Portal('<portal_URL>'); var point_layer = FeatureSetByPortalItem(p, '<pointlayer_id>'); var poly_layer = FeatureSetByPortalItem(p, '<polygonlayer_id>'); var OutputDict = { 'fields': [{ 'name': '<field_name>', 'type': 'esriFieldTypeString'}, {'name': 'f_count','type': 'esriFieldTypeInteger'}], 'geometryType': '', 'features': []}; var index = 0; var num_points_intersecting; for (var f in poly_layer) { Console(f["name"]) num_points_intersecting = Count(Intersects(f, point_layer)); Console(num_points_intersecting) OutputDict.features[index] = { 'attributes': { 'name': f['name'], 'f_count': num_points_intersecting } } Console(OutputDict.features[index]); index++; } Console(OutputDict); var dict_text = Text(OutputDict); Console(dict_text); var mydict = FeatureSet(dict_text); Console(mydict);
return mydict;
The image shows the full working script.
The dashboard shows the point feature counts of each polygon using the Indicator element.
Article ID: 000031381
Get help from ArcGIS experts
Download the Esri Support App