2

I am working on a semester project for my GIS Programming and Customization course. I built a model that receives updated crime point data from the City of Denver as an input.

The sequence of tools that I have strung together in the model are as follows: Select Layer by Attributes (because I only want to use crime points that represent reports of domestic violence), Create Feature Class, Add Field (this is a numeric field named "Count"), and Calculate Field (populates all records with the value of 1).

Now I have a new feature class that consists of points where domestic violence crimes have been reported and each record is populated with the value of 1 in the "Count" field. I want to join this data to a separate polygon feature class (Census Neighborhood Demographics), so that my resulting polygon feature class ends up with a "Sum Count" field that represents the total number of domestic violence crimes that have been reported in that neighborhood.

I tried including the Spatial Join tool in my model in order to complete this step, but when I run the model (or try using the tool manually), my output polygon feature class still shows every record populated with the value of 1, rather than the sum of crime points.

I have done this whole process manually before, but by right-clicking on my target layer and choosing to join it to another layer based on spatial location. I noticed that this operation is called "Join Data". The dialog window is very different than that of the Spatial Join tool. I have tried searching for a tool called "Join Data", with no success.

Does anyone have any suggestion for how I can make my model do what I was able to do manually by right-clicking on my target layer and opening the "Join Data" tool?

I am very open to using a snippet of Python script, but I am new to the programming language and am not sure how to accomplish my goal with code.

3
  • What version of ArcMap are you using? You can definitely do this with a spatial join!
    – GISHuman
    Commented Nov 2, 2017 at 20:02
  • Have you tried Add Join?
    – PolyGeo
    Commented Nov 2, 2017 at 20:04
  • 1
    Spatial Join will do exactly what you need, but may take a long time, and will produce an intermediate feature class. @PolyGeo's suggestion for the "Add Join" tool is exactly what you would achieve by right-clicking in the table of contents, and would link the tables based on a specified key field
    – AlecZ
    Commented Nov 2, 2017 at 20:17

1 Answer 1

3

You can do this using a spatial join in ArcGIS. The steps you described in your question is the correct workflow, however you want to specify a merge rule. Right click on your count field under "field map" and choose "sum". enter image description here

This should give you a total # domestic violence crimes for each polygon.

You can input this into model builder by choosing the field map parameter as an option (right click on Spatial join). Although, I think Python may be a better solution and there's examples in the help for Spatial Join for this exact scenario.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.