Creating a layer symbology file

In a model or script, you can specify how output data is to be symbolized when added to the ArcMap,ArcGlobe, or ArcScene table of contents using one of the following techniques:

  1. In ModelBuilder, set the Layer Symbology property of the output variable.
  2. For a script tool, set the Symbology property of an output parameter.
  3. Use the Apply Symbology From Layer tool in your script or model.

All three techniques use a layer file (.lyr) that defines the symbology used to draw output data when it is added to the display. When a layer file is used to define the symbology of tool outputs, it is referred to as a layer symbology file.

Creating a layer symbology file for ModelBuilder

Steps:
  1. Start ArcMap and edit your model in ModelBuilder.
  2. Run your model in ModelBuilder.
  3. Add the desired output variable to the display by right-clicking the variable and clicking Add To Display. This creates a new layer in the ArcMap table of contents.
  4. In ArcMap, double-click the new layer to open its properties, then click the Symbology tab. Change the symbology to how you want the model output to be displayed.
  5. NoteNote:

    If you are using a classification (such as unique values) to symbolize your data, you can choose to have the output data reclassified, causing the legend to change when the data is refreshed. See the sections below for information on how to force reclassification.

  6. Click OK.
  7. Right-click the layer and click Save As Layer File.
  8. In ModelBuilder, right-click the output variable and choose Properties.
  9. Click the Layer Symbology tab and enter the path to the .lyr file you saved above.
  10. Save your model.

The next time you run your model, either within ModelBuilder from the tool dialog box, the output will be symbolized using the symbology defined in the .lyr file.

NoteNote:

The layer file must exist each time the model is run. If it does not exist, the model still runs, but the data is drawn with the default symbology.

To create a layer symbology file to use with the output of a script tool:

Steps:
  1. Execute your script tool to add the output layers to the table of contents.
  2. Follow the steps above to change symbology of the output layers and save a .lyr file.
  3. In the Catalog window:
    1. Right-click the script tool and choose Properties.
    2. Click the Parameters tab.
    3. Select the output parameter.
    4. In the Parameter Properties section, set the Symbology property to the layer file saved above.
  4. Click OK.

The next time you run your script the output will be symbolized using the symbology defined in the .lyr file.

NoteNote:

The layer file must exist each time the script is run. If it does not exist, the script still runs, but the data is drawn with the default symbology.

Setting layer symbology using unique value category

When you are symbolizing data in categories, the state of the <all other values> check box, illustrated in the table below, determines how the data will be symbolized.

All Other Values checked

Checked—The data will be symbolized as specified. The legend is unchanged. No new categories are created. This is referred to as static symbology.

All Other Values unchecked

Unchecked—The data will be read, and new categories will be created based on the data. The legend will change. This is referred to as dynamic symbology.

Following are details about how data in categories is drawn when using a layer symbology file or the Apply Layer From Symbology tool.

Unique Value symbology

If your symbology layer file defines unique categories like the above illustration, there are rules that determine how the output is drawn.

Setting layer symbology using quantities

You can also symbolize output data by quantities. The screen shot below shows the properties of a graduated color quantity. The value field is Score, and the number of classes is five.

Symbology using Quantities

Learn more about classifying data using graduated colors

If your symbology layer file defines quantities like the above illustration, there are a few rules that apply.

You can force the same classification to be used regardless of the values found on the output data:

Steps:
  1. Select Graduated colors and a field value and click Classify.
  2. From the classification method, choose Manual.
  3. Enter the break values to set the classification.
    Changing classification

Related Topics

10/29/2012