摘要
Counting the number of point features within a polygon is a basic and useful statistic in performing spatial analysis. The image below shows a polygon layer of some hypothetical regions in Washington State, and a point layer of cities within them.
This article provides the instructions to determine the number of cities in each of these regions. The following steps describe two methods: using the Summarize Within, and Spatial Join tools.
过程
Using the Summarize Within tool
- Navigate to the Geoprocessing pane. Click Toolboxes > Analysis Tools > Statistics > Summarize Within.
- In the Summarize Within window, for Input Polygons, select the desired polygon layer. In this example, the input is Washington State Regions.
- For Input Summary Features, select the desired point layer. In this example, the input is Cities in WA.
- For Output Feature Class, specify an output name in the desired geodatabase location. In this example, the output name in the default geodatabase is WashingtonStateRegions_SummarizeWithin.
- Leave other parameters at default.
- Click Run.
The image below shows the attribute table of the output with the Count of Points field indicating the number of points in each polygon.
Using the Spatial Join tool
- Navigate to the Geoprocessing pane. Click Toolboxes > Analysis Tools > Overlay > Spatial Join.
- In the Spatial Join window, for Target Features, select the desired polygon layer. In this example, the polygon layer is Washington State Regions.
- For Join Features, select the desired point layer. In this example, the point layer is Cities in WA.
- For Output Feature Class, specify an output name in the desired geodatabase location. In this example, the output name in the default geodatabase is WashingtonStateRegions_Spati.
- For Join Operation, select Join one to one. Ensure the Keep All Target Features check box is checked.
- For Match Option, select Completely contains.
- Leave other parameters at default.
- Click Run.
The image below shows the attribute table of the output with the Join_Count field indicating the number of points in each polygon.