I am wondering if anyone knows if there is arcpy functionality available in ArcGIS 10.3 or can be coded easily to replicate the select visible rasters command (manually right clicking on a Mosaic Dataset Footprint in the table of contents in an ArcMap session).
1 Answer
This is similar: Use ListDataFrames()
to get current display extent and then MakeMosaicLayer()
to create a temporary mosaic.
import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd, "*")[0] # grab 1st dataframe in map
#df = arcpy.mapping.ListDataFrames(mxd, "Main")[0] # grab dataframe named 'Main'
arcpy.MakeMosaicLayer_management(
'Orthophotos', # input mosaic
'test_mosaic', # output mosaic
'#', # Optional WHERE clause
df.extent # clipping box coordinates
)
Sources: