Select to view content in your preferred language

Multiple Source Layers in Select By Location

4002
7
04-07-2015 01:20 PM
Status: Closed
Labels (1)
RobertBorchert
Honored Contributor

In the Select by Location dialog you can select multiple Target Layers.  However it would often be very helpful to be able to select multiple Source Layers.
Example I want to select all service locations that intersect A phase Secondary Overhead an Underground.   Secondary conductors are in 2 separate layers.  In order to perform the select by location it needs to be run twice and switching to Add to currently selected features. 

7 Comments
hknkocaman
UMUTÜÇOK

Link is not english, he can't understand. I examine your tool, it is completely irrelevant with issue. You are using cursor and select tool in a loop. However, he demand a tool for selecting multiple sources like in ArcObjects.

NurkuisaRametov1

Inactive link

MargaretCrawford
Status changed to: Closed

You can use the Select Layer By Location geoprocessing tool in batch mode with the Selecting Features parameter used as the batch parameter to select multiple layers. As you mentioned, remember to specify the "Add to currently selected features" Selection Type so that each successive selection adds to the overall selected features. 

MargaretCrawford_0-1681331027245.png

 

RobinHolland

@MargaretCrawford could you please explain the Batch mode in more detail. I have the same question about using multiple Select By layers in Select Layer by Location. I want to create a select by location for a polygon layer using a set distance from a line layer (streams) and also a another polygon layer (lakes). I want the resulting feature selection to contain all of the input polygons which are located within 500 feet of my stream layer as well as all of the input polygons which are located within 500 feet of my lake layer. It seems like a basic geoprocessing tool that should be available but I cannot find a way to do this without going though multiple workflows each time. Since I have to repeat this process over 50 times, it would be great to find a tool for this. 

MargaretCrawford

Hello @RobinHolland thank you for the question. Geoprocessing tools can be run in batch mode, which allows you to run the same tool multiple times using different input datasets or parameter settings. When you create a batch tool, you can choose the parameter that will drive the batch process, this is the value that will change each time the tool runs. All the other parameters will remain constant for each run.

In your example, here is how you can use a batch tool:

  1. Right-click Select Layer By Location in the geoprocessing pane and select Batch
    MargaretCrawford_1-1683063328367.png
  2. A page will open where you can choose which parameters will drive the batch process. Under Choose a Batch Parameter, you can choose Selecting Features (as shown in the screenshot above). In your case, I would suggest saving the Batch tool, then you can specify the new batch tool name and the toolbox where it will be saved.
  3. This will open the Batch Select Layer By Location tool. I tried to recreate your example in the screenshot below. 

MargaretCrawford_2-1683063497847.png

 

Note: Use Add to the current selection for the Selection Typeso that each successive selection adds to the overall selected features. 

 

You can learn more about the Batch geoprocessing in the documentation: https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/basics/batch-geoprocessing.htm

RobinHolland

Thank You! The procedure you sent seems to have worked. I was missing the final piece of choosing Add to the Current Selection. When I ran it with New Selection yesterday, I only got a selection of those features which were located within 500 feet of a stream and a lake both. Today with Add to the Current Selection, I finally got the full selection of those features located within 500 ft of a stream OR a lake. Interesting thing to note is that even though it worked, I did get a warning stating the selection type of Add to Selection was not valid. 

RobinHolland_1-1683125810084.png

It still selected the number of features I was expecting, so I am not sure why it gave me the warning. Thank you for the help!