描述
Imports data from a production schema to a themed generalization database using generalization rules defined in a Microsoft Excel spreadsheet.
注:
A product file installer is available for ArcGIS Production Mapping and ArcGIS Defense Mapping. The product files contain predefined generalization XLSM rule files, but the tool supports both XLSX and XLSM.
Learn more about Defense Mapping product files and Production Mapping product files.
使用方法
Geoprocessing models that contain logic for the generalization of data from one scale to a smaller scale are provided as part of the Production Mapping product files. These models are designed to use an optimized generalization database organized by data themes. The Generalization Rule File contains the logic for mapping production schema to a theme database that can be used by these models.
You can customize the generalization configuration using the spreadsheet without modifying the complex geoprocessing models that will perform the generalization.
It is recommended that you use an empty geodatabase as the target geodatabase. Feature classes or tables in the target geodatabase that match generalization rules will be deleted.
Features in your production schema may be used for multiple themes, so this tool should be run to import one theme of data at a time. It is important to ensure that once one theme of data has been generalized, the results of the generalization are converted back to the production schema before the next theme of data is imported.
For example, roads can be generalized as part of the transportation theme and also used as barriers in the structure theme to ensure simplified buildings do not cross roads. If the transportation theme is generalized first, many local streets can be removed. Converting back to the production schema before creating the structure theme features ensures that the removed roads are not used as part of comparisons when simplifying buildings.
Generalized data can be converted back to the production schema using the Export Generalized Data tool.
语法
arcpy.topographic.ImportGeneralizationData(input_geodatabase, target_geodatabase, rule_file, data_theme)
参数 | 说明 | 数据类型 |
input_geodatabase | The geodatabase containing data in a production schema. | Workspace |
target_geodatabase | The target geodatabase where the data optimized for generalization will be loaded. | Workspace |
rule_file | The Excel file containing the generalization rules. This file defines features participating in the generalization process and determines the data that will be loaded and how it is organized. An example rule file is provided in the product file downloads for Defense Mapping and Production Mapping. | File |
data_theme | A theme that specifies the type of data to be generalized. Available themes are automatically populated from the Generalization Rule File parameter. The values provided in the example rule file are as follows:
| String |
派生输出
名称 | 说明 | 数据类型 |
updated_geodatabase | The updated target geodatabase. | Workspace |
代码示例
The following stand-alone sample script demonstrates how to use the ImportGeneralizationData tool to import feature classes from the generalization database to the theme database.
# Name: ImportGeneralizationData_sample.py
# Description: This tool imports necessary feature classes from the generalization database into the theme database
# Import System Modules
import arcpy
# Check Out Extensions
arcpy.CheckOutExtension('Foundation')
# Setting the environment
arcpy.env.overwriteOutput = True
# Setting Local Variables
input_database = r'C:\Data\Generalization.gdb'
target_database = r'C:\Data\STRUCTURE.gdb'
rule_file = r'C:\Data\CTM50K_GeneralizationRules.xlsx'
theme = 'STRUCTURE'
# Calling the Import Generalization Data to import structure features into the STRUCTURE.gdb
arcpy.topographic.ImportGeneralizationData(input_database, target_database, rule_file, theme)
# Getting all messages, warnings, and errors from the tool run and printing the results back to the user
messages = arcpy.GetMessages(0)
warnings = arcpy.GetMessages(1)
errors = arcpy.GetMessages(2)
arcpy.AddMessage('Tool Messages: {}\nTool Warnings: {}\nTool Errors{}\n'.format(messages, warnings, errors))
# Check In Extensions
arcpy.CheckInExtension('Foundation')
环境
许可信息
- Basic: 否
- Standard: 需要 Production Mapping
- Advanced: 需要 Production Mapping