Sign up ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

New to Python! 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 cant 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


share|improve this question

1 Answer 1

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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