[GIS] Counting number of points of interests within polygon in ArcGIS ModelBuilder

arcgis-10.4arcgis-desktoparcmapmodelbuilder

I already checked all similar questions concerning this topic,
but somehow it's not working for me.

I use ArcMap 10.4.1 and want to build a script with ModelBuilder to count the number of points within my polygon. In addition the points display differnt POI'S (each poi has a unique ID) and the polygon are districts (each district with a unique ID).

Now first of all I want to count just the quantity of points within each district.

enter image description here

I already tried it with –

  • Intersect tool (output type = POINT)
  • Summary statistics (COUNT FID of Polygon)
  • Join Field

enter image description here

But all I get is 0 as a quantity …

I checked it and it seems that until summary statistics everything works as it should, but as soon I want to join the fields there is the problem that some parts of the polygon don't have any points within and I guess arcgis has some issues with that – is there a way where I can still join my table to the attributes of the polygon shape?

Best Answer

Best way to do this would be as follows:

  1. In your POI shapefile, create a field called "Dis", make it Double and keep the default value.
  2. Run your intersect as you have in your model
  3. With the output from the intersect, run a dissolve on the intersect output, using the unique identifier for your district as the dissolve field. In the dissolve tool, there is a "Statistics Fields (Optional)" setting. Here select "Dis" field you created in Step 1, and choose "COUNT" as the statistic type. The output will give you the result for "Step 1" of your question.
  4. Using the output from the intersect again, run the Dissolve tool. Under the Dissolve Fields settings, select both the District Identifier and the POI Identifier.
  5. Under the Statistics Fields, select the "Dis" field again, and "COUNT" as the Statistic Type. The output will have the district name and POI Type, with the counts of points for each POI Type.

This is step by step how I might approach it, it can be translated into the ModelBuilder quite easily.

Related Question