I know that to export a raster with a given color, you need to export it. You need to specify the parameters in the "Data Export" section in the Output raster section: Color. model and RGB. But how can this export be done for multiple rasters at the same time? I have compiled a script for batch execution, but it does not perform what I expected.
import arcpy
import os
output_folder = 'F:/mol_2_N02/1/img'
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
for lyr in arcpy.mapping.ListLayers(mxd, "", df):
if lyr.isRasterLayer:
raster_path = lyr.dataSource
if raster_path.lower().endswith('.tif'):
raster_name = os.path.basename(raster_path)
new_raster_name = raster_name.replace('.tif', '_copia.tif')
new_raster_path = os.path.join(output_folder, new_raster_name)
arcpy.CopyRaster_management(lyr, new_raster_path, '', '', '', 'NONE', 'NONE', '')
print("Finish.")
1 photo - what do I set in the Data Export so that the output raster is with the specified color
2 photo - which rasters do I need to export
3 photo - what I get after running the script
I'm trying to batch export rasters with their color scheme, which they currently have. Such rasters were obtained when executed with the "Kriging" tool.