I have created a multidimensional raster layer using the "MakeMultidimensionalRasterLayer" tool from arcgispro using the tool's python scripting and without using ArcGISPro and a map document. I created the layer as following:
p = arcpy.md.MakeMultidimensionalRasterLayer(in_multidimensional_raster=netCDF_in, out_multidimensional_raster_layer=temperature,variables=["tmin"])
Now i want to save this layer so that i can define a certain symbology to this layer file using the colorizer attribute within the file. I tried saving it using the following code but when i open the saved file in ArcGISPro, it crashes and the crash only happens because of the file otherwise its ok.
How can i achieve this?
lyr="temperature.lyr"
k=arcpy.SaveToLayerFile_management(p,lyr)
Solved! Go to Solution.
you have to use the full path to the layer on disk. That is
"c:/temp/temperature.lyr" for arcmap
"c:/temp/temperature.lyrx" for arcgis pro
Geoprocessing tools return result objects so what you are assigning to "p" is a results object not a raster. You need to obtain the actual output using getOutput() on the result object. Review the code samples in the help file .
you have to use the full path to the layer on disk. That is
"c:/temp/temperature.lyr" for arcmap
"c:/temp/temperature.lyrx" for arcgis pro
Geoprocessing tools return result objects so what you are assigning to "p" is a results object not a raster. You need to obtain the actual output using getOutput() on the result object. Review the code samples in the help file .