Book Image

Programming ArcGIS with Python Cookbook, Second Edition

By : Donald Eric Pimpler, Eric Pimpler
Book Image

Programming ArcGIS with Python Cookbook, Second Edition

By: Donald Eric Pimpler, Eric Pimpler

Overview of this book

Table of Contents (22 chapters)
Programming ArcGIS with Python Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Updating layer symbology


There may be times when you will want to change the symbology of a layer in a map document. This can be accomplished through the use of the UpdateLayer() function, which can be used to change the symbology of a layer as well as various properties of a layer. In this recipe, you will use the UpdateLayer() function to update the symbology of a layer.

Getting ready

The arcpy.mapping module also gives you the capability of updating layer symbology from your scripts by using the UpdateLayer() function. For example, you might want your script to update a layer's symbology from a graduated color to a graduated symbol, as illustrated in the following screenshot. UpdateLayer() can also be used to update various layer properties, but the default functionality is to update the symbology. Since UpdateLayer() is a robust function that is capable of altering both symbology and properties, you do need to understand the various parameters that can be supplied as an input:

How to do...