HOW TO

Count the number of point features within polygon features using Arcade in ArcGIS Pro

Last Published: August 23, 2023

Summary

Point features can overlap or coincide with polygon features on a map. Determining the number of point features located within the polygon features is important when analyzing the spatial relationship between two feature layers with common geographical attributes. In ArcGIS Pro, Arcade can be used to count the number of point features within the polygons. This article provides the workflow.

The map below shows polygon features representing counties and point features representing hypothetical towns within the counties.

A map with point and polygon features.

Procedure

  1. Open the ArcGIS Pro project.
  2. In the Geoprocessing pane, search for and select Calculate Field (Data Management Tools).
Note:
The Calculate Field tool permanently modifies the input. Esri recommends creating a copy of the input table to perform the workflow and preserve the original values.
  1. Configure the parameters in the Calculate Field pane.
    1. For Input Table, specify the polygon feature layer. In this example, county_2 is selected.
    2. For Field Name, specify a new field name to populate the field with the number of point features. In this example, the new field is test_num.
    3. For Field Type, specify a numerical field type. The Short (16-bit integer) field type is selected in this example to store the short numerical values in the field.
    4. For Expression Type, select Arcade from the drop-down list.
    5. For Expression, insert the following Arcade expressions. Replace <point_FeatureClass> with the point feature class.
//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)
  1. Click Run.
The Calculate Field pane with parameters and the Arcade expression configured.

The number of point features within the polygon features is displayed in the attribute table of the polygon feature class.

The attribute table with the field containing the number of points in each polygon.

Article ID:000031020

Software:
  • ArcGIS Pro 3 1
  • ArcGIS Pro 3 0
  • ArcGIS Pro 2 9x

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options