Create Data Loading Workspace (Data Loading)

Summary

Creates a Data Loading Workspace that can be used for data loading. The generated workspace contains a collection of Microsoft Excel workbooks.

Usage

  • The geometry of your source data will determine the types of Data Mapping folders that are generated. For example, if you only include point features, only a Points folder will be generated. This tool supports tables and feature classes as inputs.

  • Every time you run the tool, a new workspace will be generated.

  • Create or specify a predefined mapping table to help match datasets, fields, and attribute domain coded value descriptions from a source and a target schema. The table is used to bidirectionally match substrings; therefore, order is not important. The table can be used to create matches or block them.

  • The predictive field matching uses fuzzy logic built on top of the Levenshtein distance algorithm to match datasets, fields, and coded values descriptions between a source and a target.

Parameters

LabelExplanationData Type
Source to Target Mapping

Defines how source data will be mapped over to the target schema.

Value Table
Output Folder

The output folder where the Data Loading Workspace will be created.

Workspace
Calculate feature count statistics
(Optional)

Calculates the count and percentage of filled-in values for fields in the source schema. The default is False.

Boolean
Predictive Field Matching Options
(Optional)

By default, only fields with the same name are mapped in the workspace. Fields can also be mapped by checking one of the following options:

  • Field Name Similarity—This option matches field names based on similarity between the source and target.

  • Attribute Domain Coded Value Description Similarity—This option matches attribute domain value descriptions based on similarity between the source and target.

String
Predefined Mapping
(Optional)

Performs substring matching for datasets, values, and attribute domain coded value descriptions based on the Predefined Mapping table.

Table
Create Matches by Subtype
(Optional)

Attempt to create separate DataMapping workbooks by subtype if they exist. The default is True.

  • CHECKED—Tool will attempt to match subtypes if they exist and create separate DataMapping workbooks for each match.
  • UNCHECKED—Dataset matching will only be attempted at the class level. If classes contain subtypes, a subtype sheet will be created in the DataMapping workbook.

Boolean

arcpy.dltsolutions.CreateDataLoadingWorkspace(source_target, output_workspace, {calc_stats}, {match_options}, {predefined_mapping}, {match_subtypes})
NameExplanationData Type
source_target

Defines how source data will be mapped over to the target schema.

Value Table
output_workspace

The output folder where the Data Loading Workspace will be created.

Workspace
calc_stats
(Optional)

Calculates the count and percentage of filled-in values for fields in the source schema. The default is False.

Boolean
match_options
(Optional)

By default, only fields with the same name are mapped in the workspace. Fields can also be mapped by checking one of the following options:

  • Field Name Similarity—This option matches field names based on similarity between the source and target.

  • Attribute Domain Coded Value Description Similarity—This option matches attribute domain value descriptions based on similarity between the source and target.

String
predefined_mapping
(Optional)

Performs substring matching for datasets, values, and attribute domain coded value descriptions based on the Predefined Mapping table.

Table
match_subtypes
(Optional)

Attempt to create separate DataMapping workbooks by subtype if they exist. The default is True.

  • CHECKED—Tool will attempt to match subtypes if they exist and create separate DataMapping workbooks for each match.
  • UNCHECKED—Dataset matching will only be attempted at the class level. If classes contain subtypes, a subtype sheet will be created in the DataMapping workbook.

Boolean

Code sample

CreateDataLoadingWorkspace (stand-alone script)

The following stand-alone script demonstrates how to use the CreateDataLoadingWorkspace tool:

# Name: CreateDataLoadingWorkspace.py
# Description: Creates a new DataLoadingWorkspace

# Import required modules
import os
import arcpy

# Source and target workspaces with the mapping of table name to table name.
source = 'D:/data/WaterUtilities.gdb/WaterDistribution'
target = 'D:/data/Water_AssetPackage.gdb/UtilityNetwork'
mapping = [
    ('wControlValve', 'WaterDevice'),
    ('wHydrant', 'WaterJunction'),
    ('wFitting', 'WaterJunction'),
    ('wMain', 'WaterLine'),
]

# Fully qualify the table names.
source_target = [(os.path.join(source, a), os.path.join(target, b))
                 for a, b in mapping]
output_workspace = 'D:/data'
calc_stats = True

arcpy.dlt.CreateDataLoadingWorkspace(source_target=source_target,
                                     output_workspace=output_workspace,
                                     calc_stats=calc_stats)

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes