Count Points In A Polygon

2155
3
12-17-2018 06:32 AM
ScottShenberger
New Contributor III

Im somewhat new to Arcade, Is it possible to use Arcade to count points in a polygon in order to create a custom new attribute?

Tags (2)
0 Kudos
3 Replies
MarisaClaggett
Occasional Contributor II

Hi Scott,

It sounds like you are looking for the Summarize Within tool.  Are you working in AGOL or ArcGIS Pro?

Summarize Within—Help | ArcGIS Desktop 

This tool overlays a polygon layer with another layer to summarize the number of points within each polygon, and calculate attribute field statistics about those features within the polygons.  Let me know if this helps!

Best,

Marisa

XanderBakker
Esri Esteemed Contributor

Yes, you can use Arcade to do that dynamically and return the result in the pop-up window as a new attribute. There are a couple of requirements that needs to be met to do this (or both points and polygons layers should be published in the same datastore or they should be present in the same map). To see an example of what is possible, please see: Using FeatureSetBy functions in Arcade to drill-down to other layers and tables 

There is an example that counts the hydrants in a polygon and summarizes an attribute (age).

XanderBakker
Esri Esteemed Contributor

In addition to my previous reply.; you can also use this in a field calculation in ArcGIS Online (especially if the data is static).

0 Kudos