2

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).

enter image description here

1 Answer 1

1

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:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.