Search code examples
pythongisarcgisesriarcpy

arcpy command for "Select by location" tool?


I have the following data :

  • a raster catalog
  • a feature class composed of several polygons.

The polygons and the raster catalog often overlap. I want to get the polygons (the ENTIRE polygon, not part of it, and not a clip or an intersect...) which contain the raster catalog or part of it, so that I can run processes on those areas.

I checked some tools in ArcMap, and I observed that the "Select by location" tool works perfectly (and NOT the tool Select Layer by location). The result is a selection of only the polygons (from the feature class layer) that contain the raster catalog. But I can't find anything about an arcpy command...

I found the "SelectLayerByLocation_management" (Select Layer by location tool) but the resulting selection is empty, so it doesn't do the job. Plus I cannot use a ratser catalog as selecting feature, so it's a no.

Does anyone have information regarding the "Select by location" tool adptation to arcpy ? I have to use a tool that can handle raster catalog.


Solution

  • At the end I decided not to use the raster catalog, but the map index provided with the images used to create the catalog.

    I then used the arcpy command "Select Layer by Location", which does not work with raster catalogs, but works fine with map index.