Hello!
I am trying to update the symbology of a raste layer using an existing layer file with 2 different functions:
- update layer
- apply symbology from layer
The same function works with shapefiles, though.
Nothing happens, still the code runs till the end with no error message, which makes it pretty difficult to find the error.
import arcpy
arcpy.env.overwriteOutput = True
workDir = 'C:/0.STUDY PROJECT/Maps/'
mxd = arcpy.mapping.MapDocument(template)
dfs = arcpy.mapping.ListDataFrames(mxd)
df = dfs[0]
clip = "C:\\0.STUDY PROJECT\\MapsKulmbach\\processed_data\\clip"
depth_data = arcpy.mapping.Layer(clip)
arcpy.mapping.AddLayer(df, depth_data)
srcLay = workDir + "depthSymbology.lyr"
srcLayObj = arcpy.mapping.Layer(srcLay)
arcpy.mapping.UpdateLayer(df, depth_data, srcLayObj, True)
arcpy.ApplySymbologyFromLayer_management (depth_data, srcLayObj)
mxd.save()
arcpy.RefreshActiveView()
Do you know what a reason could be?
Thank you