描述
Exports data generalized by the ArcGIS Production Mapping theme-based generalization models into a production schema 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.
使用方法
The Input Geodatabase will contain the theme generalization feature classes created by the Import Generalization Data tool. Before running this tool, the Production Mapping generalization models for the data theme will be run on this database. The Target Geodatabase should be the same geodatabase that was used as the source for Input Geodatabase when the Import Generalization Data tool was run.
Before the generalized features are loaded into the Target Geodatabase, the source features are deleted to ensure that there are not multiple representations of the same real-world object in the target geodatabase.
The data theme determines which feature classes in the Input Geodatabase contain the features that will be loaded into the target geodatabase.
The Generalization Rule File contains the logic for mapping the generalized theme data back to your production schema.
Once a set of data is generalized, it can be used during the generalization of other datasets. This tool loads the generalized data back into the production geodatabase, so it can be used during different stages of the generalization process.
You can customize the generalization process using the spreadsheet without modifying the complex geoprocessing models that will perform the generalization.
While running the generalization models, some generalization tools assign a value of 1 to a visibility field to identify features that should be removed from the display at the output scale. The Export only visible features parameter can be used to specify whether only visible features will be exported, or all the features will be exported, regardless of their visibility. When running fully-automated generalization, you will most likely choose to export only visible features as this means fewer features will be included in the final database. If manual cartographic finishing is part of your generalization process, you can choose to keep the hidden features, so they can be made visible again at the discretion of the cartographer.
The Generalization Rule File parameter defines the visibility field used by the Export only visible features parameter.
语法
arcpy.topographic.ExportGeneralizedData(input_geodatabase, target_geodatabase, rule_file, data_theme, {export_visible_features})
参数 | 说明 | 数据类型 |
input_geodatabase | The geodatabase containing data in the generalization schema. | Workspace |
target_geodatabase | The geodatabase where the generalized data 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 |
export_visible_features (可选) | Specifies whether features with a value of 1 in the visibility field will be exported to the target database.
| Boolean |
派生输出
名称 | 说明 | 数据类型 |
updated_geodatabase | The updated target geodatabase. | Workspace |
代码示例
The following stand-alone sample script demonstrates how to use the ExportGeneralizedData tool to export generalized data from the theme database to the generalization database.
# Name: ExportGeneralizedData_sample.py
# Description: This tool exports the generalized data from the theme database to the generalization 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\STRUCTURE.gdb'
target_database = r'C:\Data\Generalization.gdb'
rule_file = r'C:\Data\CTM50K_GeneralizationRules.xlsx'
theme = 'STRUCTURE'
# Calling the Export Generalized Data to exporting structure features from STRUCTURE.gdb to Generalization.gdb
arcpy.topographic.ExportGeneralizedData(in_geodatabase, 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