1

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:

X:\DATA\DATABASE1.GDB\MAIN\POLYGON

X:\DATA\DATABASE2.GDB\POINTS1

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

closed as off-topic by Vince, Midavalo Feb 23 '17 at 5:04

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking help to debug/write/improve code must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Providing a clear problem statement and evidence of a code attempt will help others to help you. See: How to create a Minimal, Complete, and Verifiable example." – Vince, Midavalo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 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