Clear Pixel Cache (Data Management)

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.

    Note:

    The cache cannot be deleted if the mosaic dataset is open in the map.

  • The pixel cache will be regenerated from the source when the mosaic dataset is reviewed.

Parameters

LabelExplanationData Type
Mosaic Dataset

The input mosaic dataset with the pixel cache to be deleted.

Mosaic Layer
Generated Before
(Optional)

All cache generated before this date will be deleted.

Date

Derived Output

LabelExplanationData Type
Mosaic Dataset

The updated mosaic dataset with a cleared pixel cache.

Mosaic Layer

arcpy.management.ClearPixelCache(in_mosaic_dataset, {generated_before})
NameExplanationData Type
in_mosaic_dataset

The input mosaic dataset with the pixel cache to be deleted.

Mosaic Layer
generated_before
(Optional)

All cache generated before this date will be deleted.

Date

Derived Output

NameExplanationData Type
out_mosaic_dataset

The updated mosaic dataset with a cleared pixel cache.

Mosaic Layer

Code sample

ClearPixelCache example 1 (Python window)

This is a Python sample for the ClearPixelCache function.

import arcpy

arcpy.management.ClearPixelCache("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 the ClearPixelCache function.

#===========================
#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.management.ClearPixelCache(mdname, date)

Environments

This tool does not use any geoprocessing environments.