Skip to content

Instantly share code, notes, and snippets.

@maphew
Last active October 26, 2017 22:33
Show Gist options
  • Save maphew/56c65d10a150af155a02a688de9a5c1d to your computer and use it in GitHub Desktop.
Save maphew/56c65d10a150af155a02a688de9a5c1d to your computer and use it in GitHub Desktop.
How to change or assign ArcMap layer symbology type from python?
#Interactive Python window in ArcMap
import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
lyr = arcpy.mapping.ListLayers(mxd, "*", df)[0]
renderer = lyr._arc_object.renderer
>>> renderer
u"<Renderer xsi:type='typens:RasterClassifyRenderer' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
...snip...
lShader><ZScale>1</ZScale><SymbolFlipped>false</SymbolFlipped></Renderer>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment