I'm trying to re-path a multitude of rasters currently the workspace is a folder, the intended workspace is a raster catalog in an SDE database - using the replaceDataSource method I'm getting the error as below. Does anyone know if this method can't output as a Raster Catalog or what the actual problem may be?

lyr = arcpy.mapping.Layer(r"C:\Folder\MyLayer.lyr")
lyr.replaceDataSource(r"pathToSDEConnectionFile.sde","SDE_WORKSPACE","rasterCatalogName", True)

Runtime error : Layer: Unexpected error


The second argument is the type of the new dataset. I don't think a raster catalog is an sde workspace even if stored in sde; only sde connections are. Try using "RASTER_WORKSPACE" for your keyword.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.