3

I am working with ArcMap 10.8 and extensions.

I have a grid (polygons) and another shapefile of points. I need to generate a field in the grid that shows me how many points are inside each cell, but grouped by a criterion.

For example suppose that the grid are "football stadiums" and players are points. The points shape has a field called "team". If in a specific stadium there are 34 players from 3 different teams, in the count field of polygons shape we will have 3.

With spatial join tool I can only count the total points within the polygons, but I cannot count by attributes.

0

1 Answer 1

5

Here is one such solution, using this test data, players are labelled with their "team name":

Test data

Run the spatial Join Tool but set the field map up as shown below:

Field Map Note the merge rule is set to JOIN and the delimiter is a comma

The Output would be this:

Output

Now add a numeric field and run the following python in a field calculate tool:

len(set(!team!.split(",")))

Final result

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.