Summary
Clears the pixel cache associated with a mosaic dataset.
The pixel cache for a mosaic dataset can be generated by running the Add Rasters to Mosaic Dataset tool with the Enable Pixel Cache parameter checked. The pixel cache improves the performance when viewing and performing analysis on a mosaic that references rasters on cloud or slow Network Attached Storage (NAS). The cache is stored on the local machine, improving performance.
Usage
This tool allows you to manage the generated cache of a mosaic dataset by deleting the pixel cache.
The pixel cache will be regenerated from the source when the mosaic dataset is reviewed.
Syntax
ClearPixelCache(in_mosaic_dataset, {generated_before})
Parameter | Explanation | Data Type |
in_mosaic_dataset | The input mosaic dataset with the pixel cache to be deleted. | Mosaic Dataset |
generated_before (Optional) | All cache generated before this date will be deleted. | Date |
Code sample
ClearPixelCache example 1 (Python window)
This is a Python sample for ClearPixelCache.
import arcpy
arcpy.ClearPixelCache_management("c:\\test\\outputdatabase.gdb\mosaicdataset", "10/24/2018 4:15:38 PM")
ClearPixelCache example 2 (stand-alone script)
This is a Python script sample for ClearPixelCache.
#===========================
#Clear Pixel Cache
'''Usage: ClearPixelCache_management(in_mosaic_dataset, {generated_before})'''
import arcpy
#Clear Pixel Cache
mdname = r"c:\test\Clearpixelcahce.gdb\mosaicdataset"
date = "10/25/2018"
arcpy.ClearPixelCache_management(mdname, date)
Environments
This tool does not use any geoprocessing environments.