Is there a way to print out how many features are selected under a buffer for analysis purposes using Python? I have the following script where I put an 805-meter buffer around grocery stores, and brought in a shapefile called schools and wanted to know how many schools fall within 805 meters (which is 0.5 miles) of a grocery store? When I run the script it shows me the selection of schools, but I was wondering if there was a way I can make the program print or create table full of values on how many features are selected under the buffering circle. Please let me know. Thank you!
<SPAN class="comment token">#Creating features list for Buffer Analysis</SPAN>
fcList <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="string token">"schools.shp"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"BroomeGroceryStores.shp"</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN>fcList<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token">#Selecting schools that fall within 805 meters of a grocery store</SPAN>
buffList <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="keyword token">for</SPAN> fc <SPAN class="keyword token">in</SPAN> fcList<SPAN class="punctuation token">:</SPAN>
buff <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>Buffer_analysis<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"BroomeGroceryStoress.shp"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"Results/BroomeGroceryStores_buffer.shp"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"805 METERS"</SPAN><SPAN class="punctuation token">)</SPAN>
buffList<SPAN class="punctuation token">.</SPAN>append<SPAN class="punctuation token">(</SPAN>buff<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>GetMessages<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">for</SPAN> buff <SPAN class="keyword token">in</SPAN> buffList<SPAN class="punctuation token">:</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>SelectLayerByLocation_management<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"schools"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"WITHIN"</SPAN><SPAN class="punctuation token">,</SPAN> buff<SPAN class="punctuation token">,</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"ADD_TO_SELECTION"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="string token">"Done"</SPAN>
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>