Repair Raster Catalog Paths (Data Management)
Summary
Repairs broken file paths or deletes broken links within an unmanaged raster catalog or a mosaic dataset.
Usage
-
It can also be used to delete any broken links that are no longer needed.
-
You need to know the file path location in order to change it. You can use the Export Raster Catalog Paths tool to retrieve the original path names.
-
You can type an asterisk (*) as the original path if you wish to change all your paths.
-
If you need to repair a mosaic dataset, the Repair Mosaic Dataset dialog box can also achieve this task. To learn more about repairing mosaic datasets, see Repairing paths in a mosaic dataset.
Syntax
Parameter | Explanation | Data 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.
| 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
This is a Python sample for the RepairRasterCatalogPaths tool.
import arcpy
arcpy.RepairRasterCatalogPaths_management("c:/data/RepairRC.gdb/bkrnlinks",
"FIX", "*", "C:/data/newpath")
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()