概要
Compares a base and test schema and reports the differences between the two that are relevant to data loading, such as feature classes, tables, spatial references, and field definitions.
使用法
This tool only reports differences in the schema of the databases and does not compare the contents.
The base file is considered the authoritative file for the schema, while the test file contains a schema that will be compared to the base to determine whether it has the expected schema.
Comparison is done against XML workspace documents. When geodatabases are selected for the base_geodatabase_schema or test_geodatabase_schema parameters, the schema is exported to an XML workspace document before the comparison occurs.
The following table explains which schema elements are compared and provides a general description of the results.
Schema element Results description Domains
Domains and domain values that are in the base or test schema and not present in the test or base schema or have attributes that differ, such as the coded values and their descriptions.
Feature classes
Feature classes that are not present in the test or base schema or have attributes that differ, such as the name or spatial reference.
Feature datasets
Feature datasets that are present in the base or test schema but not in the test or base schema or have attributes that differ, such as the name, dataset type, and spatial reference.
Fields
Fields that are present in the base or test schema but not in the test or base schema or have attributes that differ, such as the name, type, length, precision, and scale.
Tables
Tables that are present in the base or test schema but not in the test or base schema or have attributes that differ, such as the name, alias, and field names.
Topologies
Topologies that are present in the base or test schema but not in the test or base schema or have attributes that differ, such as the feature classes and rank
This tool does not support comparison of relationship classes, annotation, networks, parcel fabric, geometric networks, and representations.
This tool does not compare system generated fields like OBJECTID, SHAPE.AREA, and SHAPE.LEN.
This tool does not support evaluation of workspaces which contain duplicate table names.
構文
arcpy.Reviewer.GeodatabaseSchemaCompare(base_geodatabase_schema, test_geodatabase_schema, output_folder_path, {ignore_options})
パラメーター | 説明 | データ タイプ |
base_geodatabase_schema | XML document or geodatabase that contains the authoritative version of the geodatabase schema. | Workspace; File |
test_geodatabase_schema | XML document or geodatabase that contains the schema to compare to the base version. | Workspace; File |
output_folder_path | Folder where the comparison report will be generated. This folder will contain other folders and files that support the derived html_output parameter. | Folder |
ignore_options [ignore_options; ignore_options,...] (オプション) | Indicates the properties that will not be compared.
| String |
派生した出力
名前 | 説明 | データ タイプ |
schema_match | The result of the schema comparison. | Boolean |
xml_output | Output XML file from the schema comparison. | File |
html_output | Output HTML report from the schema comparison. | File |
コードのサンプル
GeodatabaseSchemaCompare example (stand-alone script)
The following Python example demonstrates how to use the GeodatabaseSchemaCompare tool.
# Name: SchemaCompareExample.py
# Description: Compares two schemas and reports their differences
# Author: Esri
# Date: September 2013
import arcpy
arcpy.CheckOutExtension("datareviewer")
# Define variables
base = "c:/data/edit_sample.xml"
test = "c:/data/edit_modifications.xml"
folder = "c:/data/sc_results"
ignoreOptions="IGNORE_DATABASETOPOLOGY;IGNORE_HASMS"
# Compare the workspaces
arcpy.GeodatabaseSchemaCompare_Reviewer(base,test,folder,ignoreOptions)
環境
ライセンス情報
- Basic: 次のものが必要 Data Reviewer
- Standard: 次のものが必要 Data Reviewer
- Advanced: 次のものが必要 Data Reviewer