HOW TO
In ArcGIS Online and Portal for ArcGIS Map Viewer, calculating the number of point features within polygon features aids in spatial analysis and decision-making. For example, it is useful when quantifying and visualizing the distribution of points, such as incidents, facilities, or population data, within specific geographic areas. In this article, an Arcade expression is used to count the number of point features within the polygon features in Map Viewer.
Note: Skip to Step 3 if the script is run on an existing field.
//Define the point feature class. var point_fc = FeaturesetByName($datastore, "<point_FeatureClass>") //Identify the intersected point features. var int_point = Intersects(point_fc,$feature) //return the count of the points. return Count(int_point)
The image below demonstrates the number of point features within each polygon feature in Map Viewer.
Get help from ArcGIS experts
Download the Esri Support App