0

My university wants the maps we create to become more standardized and so we're changing all the colors on our base vector map.

The new standard needs to be indexed and I have the task of creating the spreadsheet/document that will help us in the future.

There are close to 100 layers that I need to index with, for example, the polygon layer name, fill color (rgb values), border color, and border width.

I have only recently started learning ArcPy so I was hoping there would be a GUI method I could follow and if not, what I should be looking for in an ArcPy script.

How does one extract this information?

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Jun 2, 2015 at 15:20
3
  • 1
    This sounds like it might be a manual process. I don't believe arcpy has a way to extract the fill color, border color, or border width. Most likely you could get this information with ArcObjects, but someone else would have to confirm that. Commented Jun 2, 2015 at 15:43
  • Old VBA solutions at forums.esri.com/… and forums.esri.com/Thread.asp?c=93&f=1730&t=294885 and a similar question here at gis.stackexchange.com/questions/124401 Getting the border color and width is probably something else. And as ian mentioned, likely to involve ArcObjects. Also related/other workarounds gis.stackexchange.com/questions/114850 For documentation this approach is fine I guess, but please provide .lyr files or custom styles as well, because there's no easy way to apply symbology from tabular data. Commented Jun 2, 2015 at 17:03
  • Would it be feasible for you to save lyr files which store all those things? You could open all your layers into an MXD with all the symbology set. Then, iterate through them and use arcpy.SaveToLayerFile_management Commented Jun 2, 2015 at 23:11

2 Answers 2

1

There is a way but not an easy one, since it involves creating a service definition and reading XML files.

1) Using the arcpy function CreateMapSDDraft and StageService_server you can create a .sd file.

2) Unzip the "service name".sd file.

3) Unzip the ..\v101\"service name".msd file.

4) The file ..\layers\"layername".xml holds the color codes (RGB/CMYK etc.) as seen below

So you can automate the whole process using python. enter image description here

answered Sep 13, 2017 at 11:58
0

I agree with comments by @ianbroad:

This sounds like it might be a manual process. I don't believe arcpy has a way to extract the fill color, border color, or border width. Most likely you could get this information with ArcObjects, but someone else would have to confirm that.

and @Fezter:

Would it be feasible for you to save lyr files which store all those things? You could open all your layers into an MXD with all the symbology set. Then, iterate through them and use arcpy.SaveToLayerFile_management

Personally, I would follow @Fezter's suggested method, which I have seen used very effectively at some sites I consult to.

answered Jan 25, 2017 at 0:39

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.