I have a point feature and a polygon feature and want to join the point to the polygon so that I can get the count for each polygon. Question is the points are grouped by a filed called type, it has like "A","B","C", etc.

Is there a way to join grouped points by the "type" field so that after joining, I'm going to have the polygon feature with fields like "CountA", "CountB", etc., and the it reflects the number of the points falls in that polygon respectively?

I don't see a query statement option in the spatial join function and currently my solution is to create different point features by "type" field, and make the spatial join respectively.

Is there an easier way to do that?

Polygon and points are stored in file geodatabase as below:



Either in python window or stand-alone script will be fine.

  • 1
    Welcome to GIS SE! As a new user be sure to take the Tour. For questions that involve code we ask that you show us where you are stuck with your own code by including a code snippet in your question. There is an edit button beneath your question which will enable you to do that and a {} button that enables you to format any highlighted code nicely. – PolyGeo Feb 23 '17 at 0:13
  • HOw about modelbuilder? Or do you only want code? – jbalk Feb 23 '17 at 3:55
  • I wouldn't waste time with a join when an Identity and summary statistics would solve the problem. But if I was using a spatial database the join is trivial. Please edit your question to specify the data storage. – Vince Feb 23 '17 at 4:09
  • @jbalk thanks, model builder would be fine. Any ideas? – Jason Zhang Feb 23 '17 at 4:26
  • 1
    @JasonZhang GIS SE is not a code writing service. Please edit your question to include a code snippet that you've tried and information about what happens when you try it. – Midavalo Feb 23 '17 at 5:04