I wanted to know if I am on the right track here with what I am trying to do. I have two shapefiles, the first contains point data for all the businesses in DC and the other contains point data all the Metro stations in DC. What I am trying to accomplish is to find all the businesses that are within a 500 Meter radius of a metro station, then find all coffee shops that are within a 500 meter radius of a metro station.
Here is what I have so far:
import arcpy arcpy.env.workspace = 'C:/Users/new/Desktop/' arcpy.MakeFeatureLayer('DC_POI.shp','DCPts') arcpy.MakeFeatureLayer('DC_MetroStations.shp','StationPts') arcpy.Buffer_analysis('StationPts','MyShapefile.shp','500 Meters','#','#','#','#','#') arcpy.SelectLayerByLocation_management('DCPts','intersect','StationPts') arcpy.SelectByAttribute_management('DCPts','SUBSET_SELECTION',"category='CoffeeShop'") counter = arcpy.GetCount_management('DCPTs') print(counter)
when it prints counter, it is 0. I want to after every selection analysis to count the number of POI that are still selected in the layer.
I know I should use buffer analysis to buffer the metro stations by the that radius and create a new shapefile. So I think that was accomplished. And then use Select Layer By Location analysis that way I select all POI that intersect the new buffered dataset.