I am using ArcGIS 10.4.1 and Python 2.7.10.
I have a mxd file of a rather large area which contain hundred of layers. I wish to work in a specific sub-area in that workspace, where only a few layers will be relevant.
I was looking for a way to output a list of the layers which are spatially overlapping with the current view (sub-area) in ArcMap. The layers could be visible or not, as checked (or not) in the workspace. The mxd is up to date with this view.
Is such a thing possible?
I am using as a basis the following code, which output all the layers in the workspace:
import arcpy mxd = arcpy.mapping.MapDocument(r"C:\path\to\file.mxd") df = arcpy.mapping.ListDataFrames(mxd, "Layers") print arcpy.mapping.ListLayers(mxd,"", df)
EDIT: a practical example to illustrate would resemble to this: Let's say I have dozen of layers from topographical maps and ground features (water, river, topoline-level, roads, electric line, settlements, glaciers, reservations, highways, airports, and forests) at a country scale.
I zoom in a very remote forested area, where only the layers forest, river, topoline-level are overlapping the view. All other are not relevant. I am looking if it is possible to arcpy those forest, river and topoline layers in a list and discard the other.