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:
- Finding points that are within a set distance of other points
- Finding points a certain distance from each other
Also wondering if this might work: