Monday, 6 May 2019

arcgis desktop - Changing Symbology of Multiple Layers using ArcMap/ArcPy?


Is there a way to change symbology for multiple layers in ArcMap or ArcCatalog. I want to change the symbology of multiple layers at once.



Answer



Edit You can use this script provided by ESRI to complete the task at hand (same idea as below):


import arcpy
arcpy.ApplySymbologyFromLayer_management("in_layer", "in_symbology_layer")



in_layer : The layer to which the symbology will be applied.
Feature Layer;Raster Layer; TIN Layer;Network Analysis Layer


in_symbology_layer : The symbology of this layer is applied to the Input Layer.
Feature Layer; Raster Layer;TIN Layer; Network Analysis Layer



Or extend this in the form of standalone scripting (think IDLE):


import arcpy
from arcpy import env


# Set the current workspace
env.workspace = "path/to/workspace"

# Set layer to apply symbology to
inputLayers = ["in_layer_first.lyr","in_layer_second.lyr","in_layer_third.lyr"]

# Set layer that output symbology will be based on
symbologyLayer = "in_symbology_layer.lyr"


# Apply the symbology from the symbology layer to the input layer
for layer in inputLayers:
arcpy.ApplySymbologyFromLayer_management (layer, symbologyLayer)

In essence, you create a symbology layer (in_symbology_layer) that you maintain with respect to design/style. Then you copy that layers symbology on to each of your other layers as listed in your table of contents.




Previous Answer


You can use a style from a current layer in your table of contents/layer list and apply it to your other layers.


For each subsequent layer (below your intended style layer) > right click > properties > symbology > import style from other layer


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...