Append (Data Management)
Summary
Appends multiple input datasets into an existing target dataset. Input datasets can be point, line, or polygon feature classes, tables, rasters, raster catalogs, annotation feature classes, or dimensions feature classes.
To combine input datasets into a new output dataset, use the Merge tool.
Illustration
Usage
-
Use this tool to add new features or other data from multiple datasets into an existing dataset. This tool can append point, line, or polygon feature classes, tables, rasters, raster catalogs, annotation feature classes, or dimensions feature classes into an existing dataset of the same type. For example, several tables can be appended to an existing table, or several rasters can be appended to an existing raster dataset, but a line feature class cannot be appended to a point feature class.
-
The Append tool's Field Map control can be used to control how the attribute information from the input dataset fields is transferred to the target dataset. The Field Map control can only be used if the Schema Type NO_TEST is specified.
-
This tool will not planarize features when they are added to the target dataset. All features from both the input feature class and the target feature class will remain intact after the append, even if the features overlap. To combine, or planarize feature geometries, use the Union tool.
-
If the Schema Type TEST is specified, the schema (field definitions) of the input datasets must match that of the target dataset in order for the features to be appended. If the Schema Type NO_TEST is specified, input dataset schema (field definitions) do not have to match the target dataset. However, any fields from the input datasets that do not match the fields of the target dataset will not be mapped to the target dataset unless the mapping is explicitly set in the Field Map control.
-
Because the input datasets' data is written into an existing target dataset that has a predefined schema (field definitions), the Field Map control does not allow for fields to be added or removed from the target dataset.
-
If the spatial references of an input and target feature class do not match, the Append tool will project the features in the input feature class to the coordinate system used by the target feature class.
-
This tool does not perform edge matching—there will be no adjustment to the geometry of features.
-
Map layers can be used as Input Datasets. If a layer has a selection, only the selected records (features or table rows) are used by the Append tool.
-
This tool cannot use multiple input layers with the same name. Although ArcMap allows for the display of layers with the same name, these layers may not be used. To work around this limitation, use the tool dialog box browse button to browse for the full paths of each of the Input Datasets.
-
To use the Subtype parameter, the target dataset must have a defined subtype field and assigned subtype codes. In the Subtype parameter, provide a subtype description to assign that subtype to all new data that is appended to the target dataset.
Syntax
Parameter | Explanation | Data Type |
inputs [inputs,...] |
The input datasets whose data will be appended into the target dataset. Input datasets can be point, line, or polygon feature classes, tables, rasters, raster catalogs, annotation feature classes, or dimensions feature classes. Each input dataset must match the data type of the target dataset. | Table View; Raster Layer |
target |
The existing dataset that the input datasets' data will be appended into. Each input dataset must match the data type of the target dataset. | Table View; Raster Layer |
schema_type (Optional) |
Specifies if the schema (field definitions) of the input datasets must match the schema of the target dataset in order for data to be appended.
| String |
field_mapping (Optional) |
Controls how the attribute information in input datasets' fields is transferred to the target dataset. This parameter can only be used if the Schema Type NO_TEST is specified. Because the input datasets' data is appended into an existing target dataset that has a predefined schema (field definitions), fields cannot be added or removed from the target dataset. Merge rules allow you to specify how values from two or more input fields are merged into a single output value. There are several merge rules that you can use:
| Field Mapping |
subtype (Optional) |
A subtype description to assign that subtype to all new data that is appended to the target dataset. | String |
Code Sample
The following Python window script demonstrates how to use the Append tool in immediate mode.
import arcpy arcpy.env.workspace = "C:/data/" arcpy.Append_management(["north.shp", "south.shp", "east.shp", "west.shp"], "wholecity.shp", "TEST","","")
The following script demonstrates how to use the Append tool.
# Name: Append.py # Description: Use the Append tool to combine several shapefiles # import system modules import arcpy, os from arcpy import env # Set environment settings env.workspace = "C:/data" # Set local variables outLocation = "C:/Output" emptyFC = "MA_towns.shp" schemaType = "NO_TEST" fieldMappings = "" subtype = "" try: # Process: Create a new empty feature class to append shapefiles into arcpy.CreateFeatureclass_management(outLocation, emptyFC, "POLYGON", "amherst.shp") # All polygon FCs in the workspace are MA town shapefiles, we want to append these to the empty FC fcList = arcpy.ListFeatureClasses("","POLYGON") # list will resemble ["amherst.shp", "hadley.shp", "pelham.shp", "coldspring.shp"] # Process: Append the feature classes into the empty feature class arcpy.Append_management(fcList, outLocation + os.sep + emptyFC, schemaType, fieldMappings, subtype) except: # If an error occurred while running a tool print the messages print arcpy.GetMessages()