I'm using Desktop 10.2 and I tried ,with this script, to add ecw file to mxd's but the result is a black & white raster(stretched symbology) instead of colored raster(RGB composite symbology) :
import arcpy
import arcpy.mapping
import os
import sys
from arcpy import env
import string
env.workspace = r"C:\project"
for mxd in arcpy.ListFiles("*.mxd"):
print mxd
mapdoc = arcpy.mapping.MapDocument(r"C:\project\\" + mxd)
df = arcpy.mapping.ListDataFrames(mapdoc, "Layers")[0]
Layer1 = arcpy.mapping.Layer(r"C:\project\layers\F1292_KVISH6_25CM_.ecw")
arcpy.mapping.AddLayer(df ,Layer1 )
mapdoc.save()
del mxd # i added
this is the image i get:
i don't know how to changed the python script so i will get RGB colored image ?
Answer
Manually save a layer file of the raster in the r g b format. Then, use the same code as you did, but reference the saved .lyr file instead.
No comments:
Post a Comment