描述
将带有色彩映射表的单波段栅格转换为三波段(红、绿和蓝)栅格。
代码示例
本示例将带有色彩映射表的栅格转换为三波段 RGB 栅格。
from arcpy.ia import *
out_slope_with_colormap = ColormapToRGB("elevation_raster.tif")
out_slope_rgb_3bands.save("C:/arcpyExamples/outputs/elevtion_rgb_3bands.tif")
本示例将带有色彩映射表的栅格转换为三波段 RGB 栅格。
# Import system modules
import arcpy
from arcpy.ia import *
# Set the analysis environments
arcpy.env.workspace = "C:/arcpyExamples/data"
# Set the local variables
in_raster = "slope_raster.tif"
# convert the raster with colormap to a RGB 3bands raster
out_slope_rgb_3bands = ColormapToRGB(in_raster)
# save the output
out_slope_rgb_3bands.save("C:/arcpyExamples/outputs/slope_rgb_3bands.tif")