I'm trying to add the symbology of an already existing layer in my folder to a the slope map being created by my Python script. I'm getting this error, however, and I don't know why.
Code:
def main():
import arcpy
from arcpy.sa import *
arcpy.CheckOutExtension("Spatial")
arcpy.env.workspace = "C:\\Users\\user\\OneDrive\\Documents\\ArcGIS\\ArcMap_Folder"
inRaster = "USGS_13_n37w082_20220512.tif"
outSlope = Slope(inRaster, "PERCENT_RISE")
outSlope.save("C:\\Users\\user\\OneDrive\\Documents\\ArcGIS\\ArcMap_Folder\\slope2.tif")
myRemapRange = RemapRange([[0, 3.99, 1], [4, 9.99, 2], [10, 15.99, 3], [16, 30.99, 4], [31, 60.99, 5], [61, 999999, 6]])
outReclassRR = Reclassify(outSlope, "VALUE", myRemapRange,"NODATA" )
outReclassRR.save("C:\\Users\\user\\OneDrive\\Documents\\ArcGIS\\ArcMap_Folder\\reclass2.tif")
arcpy.management.MakeRasterLayer(outReclassRR, "outReclassRR_layer")
arcpy.management.ApplySymbologyFromLayer(outReclassRR, "reclass_copy.lyr")
if __name__ == '__main__':
main()
Error:
Runtime error Traceback (most recent call last): File "<string>", line 20, in <module> File "<string>", line 16, in main File "c:\program files (x86)\arcgis\desktop10.8\arcpy\arcpy\management.py", line 6944, in ApplySymbologyFromLayer raise e ExecuteError: ERROR 000732: Input Layer: Dataset C:\Users\darel\OneDrive\Documents\ArcGIS\ArcMap_Folder\reclass2.tif does not exist or is not supported ERROR 000968: The symbol layer does not match the input layer
I'm using ArcMap,.
reclass_copy.lyr
? You are not showing us this so no one can comment.