Is it possible to change raster symbology (from 'stretched' to 'rgb composite') in an mxd using python?

1337
3
02-13-2017 12:08 PM
petegillard
New Contributor III

i'm updating a bunch of mxd's, including adding new orthophotos stored in a mosaic dataset. They keep coming in as stretched with 2.5 SDs with a blue color ramp. Need them as rgb composites with no stretch.

Any suggestions?

thanks in advance,

Pete

Tags (2)
0 Kudos
3 Replies
IanMurray
Frequent Contributor

If you have a layer file (.lyr) saved with the symbology you want, you should be able to have it apply to raster layers within a map document(I haven't tested this).

http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/apply-symbology-from-layer.ht...

Since that RGB composite does not fall under a symbology class type that is support by python, you can't change to it directly through the layer's properties(this I did check).

http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/layer-class.htm

petegillard
New Contributor III

Thanks,

It ran with no problems (got positive gp messages as it progressed ) but, it did not retain the layer file symbology. HOWEVER, I had not considered saving the mosaic dataset to a layer, so loaded the layer instead, and it appears to be a work around .

Thanks again.

0 Kudos
Kateryna
New Contributor

In 2022 , ArcGIS Pro 3.0 seems to still have this issue. Hope the improvements will be planned soon for arcpy API. 

0 Kudos