arcgis.geoanalytics.manage_data module

These tools are used for the day-to-day management of geographic and tabular data.

copy_to_data_store copies data to your ArcGIS Data Store and creates a layer in your web GIS.

append_data

manage_data.append_data(append_layer, field_mapping=None, gis=None)

Only available at ArcGIS Enterprise 10.6.1 and later.

The Append Data task appends tabular, point, line, or polygon data to an existing layer. The input layer must be a hosted feature layer. The tool will add the appended data as rows to the input layer. No new output layer is created.

Argument

Description

input_layer

required FeatureLayer , The table, point, line or polygon features.

append_layer

required FeatureLayer. The table, point, line, or polygon features to be appended to the input_layer. To append geometry, the append_layer must have the same geometry type as the input_layer. If the geometry types are not the same, the append_layer geometry will be removed and all other matching fields will be appended. The geometry of the input_layer will always be maintained.

field_mapping

Defines how the fields in append_layer are appended to the input_layer.

The following are set by default:

  • All append_layer fields that match input_layer schema will be appended.

  • Fields that exist in the input_layer and not in the append_layer will be appended with null values.

  • Fields that exist in the append_layer and not in the input_layer will not be appended.

Optionally choose how input_layer fields will be appended from the following:

  • AppendField - Matches the input_layer field with an append_layer field of a different name. Field types must match.

  • Expression - Calculates values for the resulting field. Values are calculated using Arcade expressions. To assign null values, use ‘null’.

gis

optional GIS, the GIS on which this tool runs. If not specified, the active GIS is used.

Returns

boolean

calculate_fields

manage_data.calculate_fields(field_name, data_type, expression, track_aware=False, track_fields=None, output_name=None, gis=None)

The Calculate Field task works with a layer to create and populate a new field. The output is a new feature layer, that is the same as the input features, with the additional field added.

Argument

Description

input_layer

required service , The table, point, line or polygon features containing potential incidents.

field_name

required string, A string representing the name of the new field. If the name already exists in the dataset, then a numeric value will be appended to the field name.

data_type

required string, the type for the new field. Values: Date |Double | Integer | String

expression

required string, An Arcade expression used to calculate the new field values. You can use any of the Date, Logical, Mathematical or Text function available with Arcade.

track_aware

optional boolean, Boolean value denoting if the expression is track aware. Default: False

track_fields

optional string, The fields used to identify distinct tracks. There can be multiple track_fields. track_fields are only required when track_aware is true.

output_name

optional string, The task will create a feature service of the results. You define the name of the service.

gis

optional GIS, the GIS on which this tool runs. If not specified, the active GIS is used.

Returns

Feature Layer

copy_to_data_store

manage_data.copy_to_data_store(output_name: str = None, gis=None)

Copies an input feature layer or table to an ArcGIS Data Store and creates a layer in your web GIS.

For example

  • Copy a collection of .csv files in a big data file share to the spatiotemporal data store for visualization.

  • Copy the features in the current map extent that are stored in the spatiotemporal data store to the relational data store.

This tool will take an input layer and copy it to a data store. Data will be copied to the ArcGIS Data Store and will be stored in your relational or spatiotemporal data store.

For example, you could copy features that are stored in a big data file share to a relational data store and specify that only features within the current map extent will be copied. This would create a hosted feature service with only those features that were within the specified map extent.

Parameters:

input_layer: Input Layer (feature layer). Required parameter.

output_name: Output Layer Name (str). Required parameter.

gis: Optional, the GIS on which this tool runs. If not specified, the active GIS is used.

Returns:

output - Output Layer as a feature layer collection item

overlay_data

manage_data.overlay_data(overlay_layer, overlay_type='intersect', output_name=None, gis=None)

Only available at ArcGIS Enterprise 10.6.1 and later.

Argument

Description

input_layer

required FeatureLayer. The point, line or polygon features.

overlay_layer

required FeatureLayer. The features that will be overlaid with the input_layer features.

overlay_type

optional string. The type of overlay to be performed. Values: intersect, erase

  • intersect - Computes a geometric intersection of the input layers. Features or portions of features that overlap in both the inputLayer and overlayLayer layers will be written to the output layer. This is the default.

  • erase - Only those features or portions of features in the overlay_layer that are not within the features in the input_layer layer are written to the output.

output_name

optional string. The task will create a feature service of the results. You define the name of the service.

gis

optional GIS. The GIS object where the analysis will take place.

Returns

FeatureLayer