Working with layers and table views

The most common input to a tool is a dataset. You can, of course, always browse to the dataset on disk, but you can also use layers or table views as input.

  • A layer is what you see in the Contents pane. A layer contains the path to the dataset along with symbology information and feature selection information.
  • Table views are the table equivalent of a layer. They are tables stored in memory and are the same as the table view created when a table is added to a map. Tables are listed in the Contents pane under Standalone Tables.
Note:

Any tool that operates on a table will also operate on a feature class or feature layer. This is because feature classes are simply tables with an attribute containing the shape of the feature. In all other respects, they are a table.

When you open a geoprocessing tool in ArcGIS Pro or enter a tool name in the Python window, the following will occur:

  • The tool parameters are examined to see which parameters use an input dataset or table. If one is found, the type of input is further examined to determine if it is a point feature class, TIN, network, table, or something else.
  • The Contents pane is then scanned and filtered to determine if any layers match the parameter's dataset type. If so, a list is built of the matching layer and provided as a drop-down list for the parameter. You can choose one of these layers or table views as your input.

Using layer files

Layers can be saved to disk as a layer file (a file with a .lyrx extension) and used as input to any tool that accepts a layer.

A layer file contains the same information as a layer (such as a layer in the Contents pane), including a selection of the features.

To create a layer file, you can use the Save To Layer File tool. In ArcGIS Pro, you can also right-click the layer in the Contents pane and click Save as Layer File.

For any tool that accepts a layer, you can browse to a layer file (.lyrx) on disk just as you would browse to a dataset on disk. However, when you browse to a layer file, some tools are unable to determine the type of data contained in the layer file and will show you all the layer files. If you choose an inappropriate layer file, the tool will display an error or warning.


In this topic
  1. Using layer files