Merge Layers (Standard Feature Analysis)

Summary

Copies all features from two layers into a new layer. The layers to be combined must contain the same feature types (points, lines, or polygons). You can control how the fields from the input layers are joined and copied.

Illustration

Merge Layers

Usage

  • The inputs must be of the same feature type.

  • By default, all of the fields from both inputs will be copied to the output. Optionally, you can choose to modify the fields from the merge layer using the merging attributes options rename, remove, and match.

Syntax

arcpy.sfa.MergeLayers(inputLayer, mergeLayer, outputName, {mergingAttributes})
ParameterExplanationData Type
inputLayer

The point, line, or polygon features to merge with the merge layer.

Feature Set
mergeLayer

The point, line, or polygon features to merge with the input layer. The merge layer must contain the same feature type (point, line, or polygon) as the input layer.

Feature Set
outputName

The name of the output layer to create on your portal.

String
mergingAttributes
[[Merge field, Action, Input Field],...]
(Optional)

A list of values that describe how fields from the merge layer are to be modified and matched with fields in the input layer. By default, all fields from both inputs will be carried across to the output layer.

If a field exists in one layer but not the other, the output layer will contain both fields. The output field will contain null values for the input features that did not have the field. For example, if the input layer contains a field named TYPE but the merge layer does not contain TYPE, the output will contain TYPE, but its values will be null for all the features copied from the merge layer.

You can control the following merge actions (how fields on the merge layer are written to the output).

  • REMOVE—The merge layer field will be removed from the output layer.
  • RENAME—The merge layer field will be renamed in the output. You cannot rename a field from the merge layer to a field from the input layer. If you want to make field names equivalent, use the match option.
  • MATCH—The merge layer field is renamed and matched to a field from the input layer. For example, the input layer has a field named CODE and the merge layer has a field named STATUS. You can match STATUS to CODE, and the output will contain the CODE field with values of the STATUS field used for features copied from the merge layer. Type casting is supported (for example, double to integer, integer to string), except for string to numeric.

Value Table

Derived Output

NameExplanationData Type
output

The output layer containing the combined features and attributes from both the input and merge layers.

Feature Set

Environments

Licensing information

  • Basic: Requires your account in ArcGIS Enterprise to have the Perform Analysis privilege
  • Standard: Requires your account in ArcGIS Enterprise to have the Perform Analysis privilege
  • Advanced: Requires your account in ArcGIS Enterprise to have the Perform Analysis privilege

Related topics