Repair Raster Catalog Paths (Data Management)

License Level:BasicStandardAdvanced

Summary

Repairs broken file paths or deletes broken links within an unmanaged raster catalog or a mosaic dataset.

Usage

Syntax

RepairRasterCatalogPaths_management (in_raster_catalog, repair_mode, {original_path}, {new_path})
ParameterExplanationData Type
in_raster_catalog

The unmanaged raster catalog or mosaic dataset to be repaired.

Raster Catalog Layer; Mosaic Dataset; Group Layer; Composite Layer
repair_mode

Choose the repair mode you would like to use.

  • FIXThis option will allow you to fix the paths.
  • REMOVEThis option will remove any broken links that exist.
String
original_path
(Optional)

Type the original path that needs to be repaired. This is a required parameter if the FIX option was chosen.

If you want to change all your paths to the new path, you are able to use the asterisk (*) as the original path.

String
new_path
(Optional)

Type the new path to use. This is a required parameter if the FIX option was chosen.

Folder

Code Sample

RepairRasterCatalogPaths example (Python window)

This is a Python sample for the RepairRasterCatalogPaths tool.

import arcpy
arcpy.RepairRasterCatalogPaths_management("c:/data/RepairRC.gdb/bkrnlinks",
                                          "FIX", "*", "C:/data/newpath")
RepairRasterCatalogPaths example 2 (stand-alone script)

This is a Python script sample for the RepairRasterCatalogPaths tool.

##=====================
##Repair Raster Catalog Paths
##Usage: RepairRasterCatalogPaths_management in_raster_catalog FIX | REMOVE {original_path} {new_path}
try:
    import arcpy
    arcpy.env.workspace = r"C:\PrjWorkspace"
    ##Fix Broken Path - regardless of original paths
    arcpy.RepairRasterCatalogPaths_management("RepairRC.gdb\\Unmanaged", "FIX", "*", r"C:\data")
    ##Remove Broken Items
    arcpy.RepairRasterCatalogPaths_management("RepairRC.gdb\\Unmanaged2", "REMOVE", "", "")
except:
    print "Repair Raster Catalog Items example failed."
    print arcpy.GetMessages()

Environments

This tool does not use any geoprocessing environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Yes
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
11/18/2013