1

I have a shapefileA that has 13 points. Each of these points is coded with a unique ID from A to M.

I created 10 different buffers (representing different distances) around each point via the multiple ring buffer (analysis). I now have a shapefileB that shows all of the buffers around each of the 13 points.

I have another shapefileC that contains thousands of points, where each point is associated with a unique code (A-M) that corresponds to a single point in shapefileA. For example, a query of “ID = A” for the shapefiles will show the one point in shapefileA, the particular set of buffers in shapefileB, and the multiple points associated (that fall within the buffers) with it in shapefileC.

Here is where I need help. What is the most efficient way, via python, to find how many points are within each buffer band for each unique ID, and then updating a new field (in shapefileB) with the number? I know I need a cursor to go through each row, then a select by location, then a count of points, and finally a new field calculation to show the sum of points within the specific distance buffer for the specific ID.

I’m not good with nesting cursors, and it seems like this is what I’ll need.

1

I think spatial join will do this...

Set Target as shapefileB, join as shapefileC.

Add a numeric field and set the merge rule to count.

Match option as INTERSECT.

Do you want to count all of the points that land in each buffer circle (the above does this) or only the ring of area between the previous and current? If the latter, you will need to minus the count from preceding buffers.

  • Thanks, DMusketeer. I didn't realize the spatial join (analysis) has a default count field. I'll have to check this out when I get home. Can anyone confirm this is the most efficient route to go? – Dane Aug 19 '15 at 14:27
  • 1
    @Dane Similar Question – DMusketeer Aug 19 '15 at 15:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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