Skip To Content

Export Generalized Data

Summary

Exports data generalized by the Esri Production Mapping theme-based generalization models into a production schema using generalization rules defined in a Microsoft Excel spreadsheet.

Note:

The Generalization Rule File is included with the product files download for Esri Production Mapping and Esri Defense Mapping. Additional generalization files and documentation are also included in this download.

Usage

  • 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. This means that the Target Geodatabase will have the ungeneralized representation of a feature and the Input Geodatabase will have the generalized representation of the same feature.

  • 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.

Syntax

ExportGeneralizedData_topographic (input_geodatabase, target_geodatabase, rule_file, data_theme, {export_visible_features})
ParameterExplanationData Type
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:

  • TRANS—A data theme that groups features in a transportation network such as roads and railways.
  • STRUCTURE—A data theme that groups structural features such as buildings.
  • HYDRO—A data theme that groups water features such as lakes and rivers.
  • SOE—A skin of the earth data theme that groups polygon features that cover the entire surface of the earth with no holes or gaps. It can consist of water, vegetation, land, and artificial features.
  • GENERAL—A data theme that groups features other than those defined by another theme.

String
export_visible_features
(Optional)

Specifies whether features with a value of 1 in the visibility field will be exported to the target database.

  • EXPORT_VISIBLEFeatures with the visibility field set to 1 will not be exported.
  • EXPORT_ALLAll features will be exported, regardless of the value in the visibility field. This is the default.
Boolean

Derived Output

NameExplanationData Type
updated_geodatabase

The updated target geodatabase.

Workspace

Code sample

ExportGeneralizedData example (stand-alone script)

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 = 1

# 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')

Environments

This tool does not use any geoprocessing environments.

Licensing information

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

Related topics