I created a Tool a while back which I was using to find people in proximity to boreholes. Tweaking it I have something you can use.
Create a text file and save it as "Species.py", copy the code below into it.
The code is messy, as it has been butchered from my old code.
import arcpy
import os
arcpy.env.overwriteOutput = True
arcpy.env.workspace = "in_memory"
source = arcpy.GetParameterAsText(0)
PopPoint1 = arcpy.GetParameterAsText(1)
PopPoint2 = arcpy.GetParameterAsText(2)
OutPutFolder = arcpy.GetParameterAsText(3)
SPP1 =arcpy.GetParameterAsText(4)
SPP2 =arcpy.GetParameterAsText(5)
Interval = arcpy.GetParameterAsText(6)
Distance = 1
x = 1
arcpy.AddMessage('Population Difference ' + str(x))
# SPP 1
while x <= int(SPP1):
arcpy.SelectLayerByLocation_management(PopPoint1, "WITHIN_A_DISTANCE",source, Distance , "NEW_SELECTION")
pop = int(arcpy.GetCount_management(PopPoint1).getOutput(0))
arcpy.AddMessage("Selected " + str(pop) + "Looking for Spp1: " + str(SPP1))
arcpy.AddMessage("Increasing buffer to " + str(Distance))
Distance += int(Interval)
x = int(pop)
arcpy.AddMessage("x is: " + str(x))
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
Out1 = "in_memory" + "\\Spp1Final"
arcpy.Buffer_analysis(source,Out1,Distance)
# SPP 2
x = 0
Distance = 1
pop = 0
while x <= int(SPP2):
arcpy.SelectLayerByLocation_management(PopPoint2, "WITHIN_A_DISTANCE",source, Distance , "NEW_SELECTION")
pop = int(arcpy.GetCount_management(PopPoint2).getOutput(0))
arcpy.AddMessage("Selected " + str(pop)+ "Looking for Spp2: " + str(SPP2))
arcpy.AddMessage("Increasing buffer to " + str(Distance))
Distance += int(Interval)
x = int(pop)
arcpy.AddMessage("x is: " + str(x))
Out2 = "in_memory" +"\\Spp2Final"
arcpy.Buffer_analysis(source,Out2,Distance)
Out3 = OutPutFolder
inMerge = Out1 + " ; " + Out2
arcpy.Merge_management(inMerge, Out3)
Once copied into the *.py file, save it.
Open ArcMap and Open your "Catalog" window.
Scroll to your working directory and right-click on a folder where you can save a Toolbox. From the right click menu select "New" then "Toolbox". Give it a name. Then in this newly created Toolbox, right click and "Add a script".
Give the script a name and fill in the details as you wish. Click next.
Where it asks for a script file, choose the *.py you just saved.
The next screen is VERY important.
See below:
From line 1 to 7
- Input City: Data Type - Feature Layer ; Type - Required ; Direction - Input
- Species 1: Data Type - Feature Layer ; Type - Required ; Direction - Input
- Species 2: Data Type - Feature Layer ; Type - Required ; Direction - Input
- Output File: Data Type - Shapefile ; Type - Required ; Direction - Output
- Lines 5 6 are the number of species you are looking for. The Data Type are all Double. This lets you change the number of species you want per species type (in case you need to later on).
- Line 7 is how much you want to increease the search distance by on each iteration. Data Type is Double ; Type - Required ; Direction - Input
Running the Tool
Once you have set up the Toolbox, double click the Tool.
Select your input point (the point from which you want the buffer drawn). This can only be a single point, do not use a point file with more than 1 point. I haven't tested it on a selection, but there is no harm in trying.
Select your 1st Species
Select your 2nd Species
Select where you want the output buffer saved
select the number of Species 1 you want to find
Select the number of Species 2 you want to find
Select the increment in distance you want the buffer to grow (the search distance). Bearing in mind the smaller the increment the more accurate the final counts will be, but the longer the tool will take.
The final output is a combined buffer of the maximum distance required to meet the species count you have identified.
Notes
The dataframe and all data within the map must be the same projection. The units of the project must be a distance unit - I use the metric system, so I have only tested this with metres.
The final output may be off by 1 or 5 counts. This is due to the increment of the search distance.
Use this as a starting point at least.