rayme1zb

Import Composite Raster Layer with arcpy

Discussion created by rayme1zb on Jun 21, 2011
Latest reply on Jun 24, 2011 by jbarrette-esristaff
Hello,

I am currently working on an automated mapping process in arcpy (using arcmap 10).

What I need to do is import two different ".tif" files into separate dataframes. lets call the first tif file "Tif_1" and the second "Tif_2".

so my TOC would look like the following:

DF1:
Tif_1

DF2:
Tif_2
Tif_1

Tif_1 is a 3 band composite image, and Tif_2 is a single band image that i want to show on top of Tif_1

The script i use is the following:

x=0

for tiff in PLlist:

#Get Name of 'tiff'
desc = arcpy.Describe(tiff)
name = desc.baseName

#Insert TrueColor into TrueColor DF
inTClyr = arcpy.mapping.Layer(TClist[x])
arcpy.mapping.AddLayer(TC,inTClyr,"TOP")
arcpy.ApplySymbologyFromLayer_management(inTClyr,symbTC)
arcpy.RefreshTOC()
arcpy.RefreshActiveView()
#Insert TrueColor into Plume DF
inTClyr2 = arcpy.mapping.Layer(TClist[x])
arcpy.mapping.AddLayer(PL,inTClyr,"TOP")
arcpy.ApplySymbologyFromLayer_management(inTClyr2,symbTC1)
arcpy.mapping.UpdateLayer(PL,inTClyr2,symbTC1, True)
arcpy.RefreshTOC()
arcpy.RefreshActiveView()

#Insert Plume into Plume DF
inPLlyr = arcpy.mapping.Layer(PLlist[x])
arcpy.mapping.AddLayer(PL,inPLlyr,"TOP")
arcpy.ApplySymbologyFromLayer_management(inPLlyr,symbPL)
arcpy.RefreshTOC()
arcpy.RefreshActiveView()


However, the problem i am having is that neither of the true color composites ("Tif_1") have their symbologies updated. They both come into their respective dataframes being displayed as single band stretched images, and even though i have saved a .lyr file with symbology as a true color composite the "Tif_1" images fail to accept the new symbology.

**though the code is incomplete here, no errors are presented when i run the code, the symbology layers just don't apply...

Outcomes