Append Data (GeoAnalytics)

Summary

Appends features to an existing hosted feature layer.

Illustration

Append Data workflow diagram
Append Data workflow

Usage

  • This geoprocessing tool is available with ArcGIS Enterprise 10.6.1 or later.

  • The Input Layer must be an existing hosted point, line, polygon, or table layer. To append to a different layer, you must create a hosted layer of that dataset first. To do this, use the Copy To Data Store tool, or share a layer to your portal. To learn more about sharing layers, see Introduction to sharing web layers.

  • The Append Layer can be a point, line, polygon, or table big data file share dataset or feature layer.

  • The Append Layer must have the same geometry type as the Input Layer. For example, append table features to table features, and point features to point features. No features will be appended if the geometry types are not the same.

  • The Append Layer must have the same time type as the Input Layer. These types can include instant, interval, or none.

  • The fields, geometry, and time of the Input Layer will not be modified.

  • The following two methods can be used to append features:

    • Append matching fields only—Only fields with matching names and types will be appended. This is the default behavior.
    • Append matching fields and resolve differences—Use the Append Fields or Append Expressions parameter to match fields with different names or to calculate values for specified fields.

      Learn more about Append Data expressions

  • Any Append Layer fields that are not matched in the Append Fields or Append Expressions parameter will be excluded from the appended results.

    For example, human migration researchers want to append datasets with the input layer and append layer schemas seen below. Both layers have a field in common, named Country of type text, and both have two additional fields with the same data type, but unique names. The input layer has the fields Pop_ and Pop_Density, and the append layer has Population and area_km2 fields. The researchers want to match the Country field to the Country field, append the Population field to the Pop_ field, and calculate the population density for the Pop_Density field using a mathematical calculation.

    Example input layer and append layer schema
    Input layer and append layer example schemas to be used in the Append Data tool

    By default, Append Data will match Country fields because they have the same field name and field type. By default, fields Pop_ and Pop_Density have no match in the append layer and will be appended with null values.

    Example default field mapping
    Default field mapping that will be applied when the Append matching fields only option is selected for the Append Method.

    Select the Append Method option of Append matching fields and resolve differences to define your own field mapping specifications. Use the Append Fields parameter to append the Input Field Pop_ with values from the Append Field Population. Use the Append Expressions parameter to calculate Pop_Density values for the appending features using the append layer fields Population and area_km2 by building the following Arcade expression: $feature["Population"]/$feature["area_km2"].

    Example defined field mapping
    Defined field mapping as specified in the Append Fields and Append Expressions parameters.

  • This geoprocessing tool is powered by ArcGIS GeoAnalytics Server. Analysis is completed on your GeoAnalytics Server, and results are stored in your content in ArcGIS Enterprise.

  • When running GeoAnalytics Server tools, the analysis is completed on the GeoAnalytics Server. For optimal performance, make data available to the GeoAnalytics Server through feature layers hosted on your ArcGIS Enterprise portal or through big data file shares. Data that is not local to your GeoAnalytics Server will be moved to your GeoAnalytics Server before analysis begins. This means that it will take longer to run a tool, and in some cases, moving the data from ArcGIS Pro to your GeoAnalytics Server may fail. The threshold for failure depends on your network speeds, as well as the size and complexity of the data. Therefore, it is recommended that you always share your data or create a big data file share.

    Learn more about sharing data to your portal

    Learn more about creating a big data file share through Server Manager

Parameters

LabelExplanationData Type
Input Layer

The hosted feature layer to which features will be appended.

Record Set
Append Layer

The layer containing features to append to the input layer.

Record Set
Append Method
(Optional)

Specifies how fields from the Input Layer will be appended with values from the Append Layer.

  • Append matching fields only —Input layer fields will only be appended if they have a matching field in the append layer. Fields without a match will be appended with null values.
  • Append matching fields and resolve differences —Input layer fields can be appended with append layer fields of the same name and different type, or with values calculated from Arcade expressions.
String
Append Fields
(Optional)

The append layer fields of the same type and different name as the input layer fields to be appended. Select the Input Field you want to append to, and the Append Field containing the values you want to append.

Value Table
Append Expressions
(Optional)

The Arcade expression used to calculate field values for the input field. Expressions are written in Arcade and can include mathematical operators and multiple fields.

Select the fields you want to append to, and enter an expression for each to calculate the values you want to append. If the layer is added to the map, the fields and helpers can be used to build an expression.

Value Table

Derived Output

LabelExplanationData Type
Append Result

The updated input to which features have been appended.

Record Set

arcpy.geoanalytics.AppendData(input_layer, append_layer, {append_method}, {append_fields}, {append_expressions})
NameExplanationData Type
input_layer

The hosted feature layer to which features will be appended.

Record Set
append_layer

The layer containing features to append to the input layer.

Record Set
append_method
(Optional)

Specifies how fields from the Input Layer will be appended with values from the Append Layer.

  • MATCHING_ONLYInput layer fields will only be appended if they have a matching field in the append layer. Fields without a match will be appended with null values.
  • FIELD_MAPPINGInput layer fields can be appended with append layer fields of the same name and different type, or with values calculated from Arcade expressions.
String
append_fields
[append_fields,...]
(Optional)

The append layer fields of the same type and different name as the input layer fields to be appended. Select the Input Field you want to append to, and the Append Field containing the values you want to append.

Value Table
append_expressions
[append_expressions,...]
(Optional)

The Arcade expression used to calculate field values for the input field. Expressions are written in Arcade and can include mathematical operators and multiple fields.

Value Table

Derived Output

NameExplanationData Type
append_result

The updated input to which features have been appended.

Record Set

Code sample

AppendData example (stand-alone script)

The following stand-alone script demonstrates how to use the AppendData tool.

# Description: Append February 2018 sales records to your ANNUAL_SALES2018 
#              hosted layer.
#              
#	Caution: AppendData updates your ANNUAL_SALES2018 layer with appended 
#          features.

# Requirements: ArcGIS GeoAnalytics Server

# Import system modules
import arcpy

# Set local variables
inputLayer = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/ANNUAL_SALES2018/FeatureServer/0"
appendLayer = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/DataStoreCatalogs/bigDataFileShares_sales2018/BigDataCatalogServer/FEBRUARY_SALES2018"
appendMethod = "FIELD_MAPPING"
fieldMapping = "Pop_ Population;State_ StateName", 
expressionMapping = "Pop_density $feature.Population/$feature.area_km2;Unused_field null"

# Execute Append Data
arcpy.geoanalytics.AppendData(inputLayer, appendLayer, appendMethod, 
                              fieldMapping, expressionMapping)

Licensing information

  • Basic: Requires ArcGIS GeoAnalytics Server
  • Standard: Requires ArcGIS GeoAnalytics Server
  • Advanced: Requires ArcGIS GeoAnalytics Server

Related topics