Select to view content in your preferred language

default symbology

2641
1
03-29-2013 01:44 PM
ScottOatley
New Contributor II
Hi Folks,

The following arcpy script adds a raster image to the TOC:

import arcpy

mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
r = arcpy.mapping.Layer('C:/myimage.sid')
arcpy.mapping.AddLayer(df, r, "TOP")


It adds images successfully but defaults them all to an unacceptable symbology.

[ATTACH=CONFIG]23085[/ATTACH]

[ATTACH=CONFIG]23086[/ATTACH]

Any suggestions on how to get the images to load with appropriate colors, i.e. grey scale or rgb?

Thanks,
Scott
0 Kudos
1 Reply
ChrisPedrezuela
Occasional Contributor III
Hi Scott,

I think you can just opt to create a LYR file for raster with correct symbology then just change datasource manually or thru python.

Cheers,
Chris P
0 Kudos