import os arcpy.env.workspace = targetPath for files in arcpy.ListRasters(): rasterPath = arcpy.Describe(files).catalogPath arcpy.MakeRasterLayer_management(rasterPath , "lyrRaster") arcpy.SaveToLayerFile_management("lyrRaster", os.path.splitext(rasterPath)[0] + ".lyr")
one more (and hopefully last) question - why is it not possible to put a parameter to the MakeRasterLayer_management out_rasterlayer field:for example:rasterPath = arcpy.Describe(files).catalogPath rasterName = "test" arcpy.MakeRasterLayer_management(rasterPath, rasterName)i get this same Execution error 000582)[000582 : Error occurred during execution.]
rasterPath = arcpy.Describe(files).catalogPath rasterName = "test" arcpy.MakeRasterLayer_management(rasterPath, rasterName)
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und vieles mehr. Neu hier? Erstelle kostenlos ein Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.