I am trying to find a way to count all the points that are only within a specified distance of 500 meters of another set of points.

My first shapefile contains a series of points of various types of businesses in an area. And the other shapefile contains only points of churches in the same area. I want to overlay the two shapefiles programmatically using python to determine how many of my original set of points lie within a 500 radius of the church points.

I've attempted to solve this is but I am running into a few problems. First is I am not sure how to extract a particular type of business from my shapefile, say barbershops, I am not sure how I would specify to python that I only want to find the number of barbershops that lie within a radius 500 Meters of all Churches in the area.

Here is what I am attempting:

import arcpy

# Unsure what exactly Buffer_analysis does, so not sure if this would work
arypy.Buffer_analysis("LocalBusinesses.shp", "C:\Users\new\pointDataBuffer.shp", "500 Meters", "#", "#", "NONE")

target_features = "C:\Users\new\churches.shp"

join_features = "C:\Users\new\LocalBusinesses.shp"

out_features = "C:\Users\new\pointDataBuffer.shp"

arcpy.SpatialJoin_analysis(target_features, join_features, out_features,"#","#","#","#","500 Meters","#")

Problems I am facing are to specific that I only want barbershops in the first shapefile. I am not sure if 500 Meters there will take care of that.

Is there a more efficient way of performing this?


Wasn't sure how to use this info, but it seems relevant:

Also wondering if this might work:



If you just want a total count of Points within 500 meters, run "Select by Location", select "Intersect the source layer feature" , enable "Apply a search distance", enter 500 for the distance and "Meters" for the unit.

|improve this answer|||||
  • Thanks klewis, but I am trying to write this into a python script. I just found the arcpy function SelectLayerByAttribute_management. Therefore I think I could use that to isolate only barbershops, but not sure how to filer/restrict it to 500 meters. – 9Tom May 2 '18 at 21:28
  • My mistake! I see that feature now. Will try it. Thank you – 9Tom May 2 '18 at 21:33

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.