Solved! Go to Solution.
import arcpy # Set the current workspace arcpy.env.workspace = "c:/data/DEMS" # Get the list of rasters in the workspace rasters = arcpy.ListRasters() for raster in rasters: ext=arcpy.Describe(raster).extent try: xmin=max(xmin,ext.XMin) ymin=max(ymin,ext.XMax) xmax=min(xmax,ext.YMin) ymax=min(ymax,ext.YMax) except NameError: xmin,ymin,xmax,ymax=ext.XMin, ext.XMax, ext.YMin, ext.YMax minext=[xmin,ymin,xmax,ymax]
import arcpy # Set the current workspace arcpy.env.workspace = "c:/data/DEMS" # Get the list of rasters in the workspace rasters = arcpy.ListRasters() for raster in rasters: ext=arcpy.Describe(raster).extent try: xmin=max(xmin,ext.XMin) ymin=max(ymin,ext.XMax) xmax=min(xmax,ext.YMin) ymax=min(ymax,ext.YMax) except NameError: xmin,ymin,xmax,ymax=ext.XMin, ext.XMax, ext.YMin, ext.YMax minext=[xmin,ymin,xmax,ymax]
I had thought that the "MINOF" command was meant to set as the minimum of all inputs in a workspace, it's not very clear on the help.No MINOF tells ArcPy to set the output extent to the minimum extent of input datasets when running a geoprocessing operation, not all datasets in a workspace. If you wanted to run a raster calculation, setting arcpy.env.extent = "MINOF" would make arcpy perform the calculation only on the area where the extents of the input rasters overlap. If you printed arcpy.env.extent, you'd still get "MINOF", but if you described the output raster and printed its extent you'd see the actual minimum extent.