ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Ayuda
  • Sign Out
ArcGIS Desktop

ArcGIS Online

La plataforma de representación cartográfica para tu organización

ArcGIS Desktop

Un completo SIG profesional

ArcGIS Enterprise

SIG en tu empresa

ArcGIS Developers

Herramientas para crear aplicaciones basadas en la ubicación

ArcGIS Solutions

Plantillas de aplicaciones y mapas gratuitas para tu sector

ArcGIS Marketplace

Obtén aplicaciones y datos para tu organización.

  • Documentación
  • Soporte
Esri
  • Iniciar sesión
user
  • Mi perfil
  • Cerrar sesión

ArcMap

  • Inicio
  • Introducción
  • Cartografiar
  • Analizar
  • Administrar datos
  • Herramientas
  • Extensiones

Load Data

  • Resumen
  • Uso
  • Sintaxis
  • Muestra de código
  • Entornos
  • Información de licenciamiento

Resumen

Moves features from one schema to another by loading data from a source to a target workspace. Data mapping rules described in a cross-reference database are applied during loading.

Learn more about creating a cross-reference database

Data that matches the schema defined in the cross-reference database for the source is appended to the target workspace. The cross-reference database contains a DatasetMapping table that lists pairs of source and target dataset names. Each source and target name pair can have a WHERE clause and a subtype. The WHERE clause defines a subset of features in the source to append to the target. Subtype identifies a subtype in the target feature class into which features are loaded.

Uso

  • The cross-reference database includes other tables that affect load data functionality. These tables enable the following operations:

    • Map fields between data sources.
    • Override values from source to target.
    • Specify different source and target schema owners for enterprise geodatabases.

    See Related Topics below for a complete list of tables in the cross-reference database and the functionality they enable.

  • Use the Dataset Mapping Definitions parameter to specify which feature classes, shapefiles, or coverages to load from the input source to the target workspace. The list of sources and targets comes from the DatasetMapping table in the cross-reference database.

  • You can only set WHERE clauses and subtypes in the DatasetMapping table in the cross-reference database. You cannot set these in the Dataset Mapping Definitions parameter.

  • The ID value used in the Dataset Mapping Definitions parameter must refer to an existing row ID in the DatasetMapping table in the cross-reference database. The row in the DatasetMapping table contains the name of the source and target datasets.

  • This tool returns the warning Source dataset [dataset name] not found or is inaccessible for each source feature class listed in the cross-reference database that is not found in the input sources workspace.

  • This tool returns the warning Target dataset [dataset name] not found or is inaccessible for each target feature class listed in the cross-reference database that is not found in the target workspace.

Sintaxis

arcpy.production.LoadData(in_cross_reference, in_sources, in_target, {in_dataset_map_defs}, {row_level_errors})
ParámetroExplicaciónTipo de datos
in_cross_reference

The path to a cross-reference database. Cross-reference databases for each product specification reside in the <install location>\SolutionName\Desktop[Version]\[ProductName]\[SpecificationName]\DataConversion directory.

Workspace
in_sources
[in_sources,...]

A list of workspaces that contain the source features to load into the target workspace.

Workspace
in_target

The target workspace that contains the schema referenced in the cross-reference database. Source features are loaded into this workspace.

Workspace
in_dataset_map_defs
[in_dataset_map_defs,...]
(Opcional)

The source to target feature class mapping list. The format of this string is id | SourceDataset | TargetDataset | WhereClause | Subtype.

String
row_level_errors
(Opcional)

Specifies whether the tool will log errors that occur while inserting new rows into feature classes and tables in the in_target parameter.

  • ROW_LEVEL_ERROR_LOGGING —Errors that occur during individual row-level inserts will be logged. This is the default.
  • NO_ROW_LEVEL_ERROR_LOGGING —Errors that occur during individual row-level inserts will not be logged.
Boolean

Salida derivada

NombreExplicaciónTipo de datos
out_target

The database where in_sources data has been loaded.

Workspace

Muestra de código

LoadData example 1 (Python window)

The following Python window script demonstrates how to use the LoadData function.

# Name: LoadData_Example.py
# Description: Executes the LoadData_production function using a single feature class in the source and target workspaces
# Requirements: Production Mapping extension

# path to the cross reference database
cross_ref_db = "C:/Program Files/ESRIDefenseMapping/Desktop10.2/Mgcp/DataConversion/MGCP_general_TRD30_GDB_to_MGCP_general_TRD30_GDB.mdb"

# the dataset mapping string
dataset_mapping = '10 | RoadL | RoadL |  | 0'

# source and target workspaces
source_workspace = "C:/data/Export_MGCP_TRD3.gdb"
target_workspace = "C:/data/mgcp_export.gdb"

# handle row level logging
logRowErrs = "NO_ROW_LEVEL_ERROR_LOGGING"

# exec the tool
arcpy.LoadData_production(cross_ref_db,source_workspace,target_workspace,dataset_mapping,logRowErrs)
LoadData example 2 (stand-alone script)

The following stand-alone script demonstrates how to use the LoadData function with three feature classes.

# Name: LoadData_standalone_Example.py
# Description: Executes the LoadData_production function with multiple feature classes in the source and target workspaces
# Requirements: Production Mapping extension

import arcpy

# check out the extension
arcpy.CheckOutExtension("foundation")

# path to the cross reference database
cross_ref_db = "C:/Program Files (x86)/ESRIDefenseMapping/Desktop10.2/Mgcp/DataConversion/MGCP_general_TRD30_GDB_to_MGCP_general_TRD30_GDB.mdb"

# the dataset mapping string
dataset_mapping = "10 | RoadL | RoadL |  | 0;34 | BuildP | BuildP |  | 0;39 | CoastA | CoastA |  | 0"

# source and target workspaces
source_workspace = r'C:\gisdata\Export_MGCP_TRD3.gdb'
target_workspace = r'c:\gisdata\mgcp_export.gdb'

# handle row level logging
logRowErrs = "NO_ROW_LEVEL_ERROR_LOGGING"

# truncate the target feature classes
arcpy.env.workspace = target_workspace + "/features/"
arcpy.DeleteFeatures_management('RoadL')
arcpy.DeleteFeatures_management('CoastA')
arcpy.DeleteFeatures_management('BuildP')

# exec the tool
arcpy.LoadData_production(cross_ref_db,source_workspace,target_workspace,dataset_mapping,logRowErrs)

# check feature count after running the tool
arcpy.GetCount_management('RoadL')
print 'RoadL ' + arcpy.GetMessage(2)

arcpy.GetCount_management('CoastA')
print 'CoastA ' + arcpy.GetMessage(2)

arcpy.GetCount_management('BuildP')
print 'BuildP ' + arcpy.GetMessage(2)

# check the extension back in
arcpy.CheckInExtension("foundation")

Entornos

  • Espacio de trabajo actual

Información de licenciamiento

  • Basic: No
  • Standard: Requiere Production Mapping
  • Advanced: Requiere Production Mapping

Temas relacionados

  • An overview of the Conversion toolset
  • Loading data into a geodatabase
  • Cross-reference mapping files
  • Creating a cross-reference database

ArcGIS Desktop

  • Inicio
  • Documentación
  • Soporte

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

Acerca de Esri

  • Quiénes somos
  • Empleo
  • Blog de Esri
  • Conferencia de usuarios
  • Cumbre de desarrolladores
Esri
Díganos su opinión.
Copyright © 2021 Esri. | Privacidad | Legal