2

I am using ArcPy within ArcGIS 10.1 and attempting to read symbology from a *.lyr file created by a raster dataset within ArcMap. My goal is to be able read out the RGB (color) values assigned to the class breaks on the dataset. It’s seems easy enough to get the lyr file into an object with:

 lyrFile = arcpy.mapping.Layer("C:/.../ReadLyrFileSymbology/conus_foresttype6.img.lyr")

However, after that I am unable to find the method or property to get symbology color (RGB) on a layer.

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Sep 13, 2013 at 2:37

2 Answers 2

2

arcpy has access to class breaks, but not to renderers. Renderers are what set the color in symbology. You need to use ArcObjects to access renderers.

answered Sep 13, 2013 at 13:33
0

If the class breaks were derived from the rasters rgb values, you might use arcpy.GetCellValue_management tool with the features centroid against the original raster?

Saving polygon symbology as RGB values in the attribute table

answered Dec 12, 2014 at 6:36

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.