Knowledge Base - Technical Articles


Technical Article   HowTo:  Count the number of point features within a polygon

Article ID: 30779
Software:  ArcGIS - ArcEditor 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1, 10 ArcGIS - ArcInfo 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1, 10 ArcGIS - ArcView 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1, 10
Platforms:  Windows 2000, XP, 2003Server

Summary

Instructions provided describe how to count the number of point features that are contained in a polygon.

Procedure

Create a count field and a spatial join between the point shapefile and the polygon shapefile.

  1. In the attribute table of the point shapefile, create a field called 'Count' of type 'Short Integer'.
  2. Calculate the Count field equal to 1 by right-clicking on the field name > Field Calculator > Enter a 1 in the white dialog area below "Count = ", and click OK.
  3. Right-click the polygon shapefile and click Joins and Relates > Joins. Click the dropdown list and select 'Join data from another layer based on spatial location'.
  4. Specify the point shapefile from Step 1.
  5. Select the first bullet, each polygon is given a summary of the numeric attributes, for Step 2, and check the 'Sum' box.
  6. At Step 3, specify an output location and click OK.
  7. A polygon shapefile with the 'Count' field indicating how many point features lie within each polygon feature is now present.

Created: 5/8/2006
Last Modified: 8/17/2011

Article Rating: (13)
If you would like to post a comment, please login

Comments

By Lomex_ - 07/13/2014 1:09 AM

Great article! It helped a lot!

Rating:

By dshubha - 02/12/2013 7:24 AM

Other - See details below.

It did not exactly work for me. Has anyone an idea what happens to the points that lie on the boundary of polygons? My point file has several such points that seem to have been counted twice since they are located at the common boundary of the polygons.

Rating:

By Mosheur - 10/03/2012 12:27 AM

Great article! It helped a lot!

Rating:

By lilli1 - 09/05/2012 3:02 PM

Great article! It helped a lot!

Thanks, the join actually does work (and properly!) though it was not intuitive at first due to the many:many problem.

Rating:

By lilli1 - 09/05/2012 2:38 PM

The article is incorrect or the solution didn’t work.

This only works if the polygons do not overlap. When collecting points that may have a 1:many or even many:many this will not work (e.g., multi buffer point collection)

Rating:

By mattkelso - 08/02/2012 7:35 AM

Great article! It helped a lot!

Why this isn't an official tool in the ArcGIS toolbox is beyond me. Luckily, it is simple to do if you stumble across the right instructions. Yes, this method does create "Count_" and "Sum_Count" columns with identical data, but it is easy enough to delete the duplicate.

Rating:

By Chad_Kopplin - 04/26/2012 10:55 AM

The article needs to be updated.

This is what I needed, it does what I need.

Rating:

By rightasrain - 10/14/2011 1:09 PM

Great article! It helped a lot!

Works great. Is there a way to get the table to recalculate itself if the shape of the polygon changes?

Rating:

By bentemb@geoinsight.no - 09/14/2011 6:16 AM

Great article! It helped a lot!

Good! Simpel and to the point.

Rating:

By Cyrillem - 06/30/2011 12:23 AM

The article needs to be updated.

Helpful but can be simplified. This method creates two fields with the results. Count_ and Sum_count

Rating:

By Anonymous - 04/05/2011 1:23 PM

The article needs to be updated.

Exactly what I was looking for!

Rating:

By Anonymous - 03/30/2011 10:19 AM

The article contains a dead link.

Will not work on data sets with Global ID numbers.

Rating:

By Anonymous - 11/12/2009 11:01 AM

The article is incorrect or the solution didn’t work.

The field name of COUNT is reserved, and you do not need to create a new field, it automatically calculates the COUNT when you do a spatial join.

Rating: