Geodatabase To Shape (Topographic Production Tools)
Summary
Exports one or more feature classes in a geodatabase to shapefiles using one of three modes: defense, generic, and Multinational Geospatial Co-Production Program (MGCP).
Each mode controls how the output shapefiles are named. The defense and MGCP export modes follow Topographic Mappingdata model requirements. The generic mode uses the same logic as the Export Features tool.
Usage
The Conversion Method parameter specifies the export mode.
Coded domain values are exported as part of the shapefile to maintain data integrity. You can export them as raw values, string descriptions, or both.
The folder that will contain the output shapefiles.
Folder
Coded Value Domain Export Mode
Specifies the method that will be used to export coded domain values.
Descriptions—Coded domain values will be exported using their descriptions rather than raw values.
Values—Coded domain values will be exported as raw values. This is the default.
Values and descriptions—Coded domain values will be exported as raw values and string descriptions
String
Conversion Method
Specifies the conversion method that will be applied.
Defense by feature class—A shapefile will be created based on the feature class name and trailing underscores will be removed from fields.
Defense by subtype—A shapefile will be created based on the subtype name, attributes applicable to that subtype will be exported, and trailing underscores will be removed from fields. This is the default.
Generic by feature class—A shapefile will be created for each feature class selected. The shapefile name must match the feature class name.
Generic by subtype—A shapefile will be created for each subtype of the feature class selected. The shapefile name must match the subtype name.
MGCP—A shapefile will be created based on the feature class subtype. The exported shapefile will be named using the geometry type prefix, for example, S for surface features, L for line features, P for point features, and the feature code. For example, the river subtype BH140 in the WatrcrsL feature class would be exported to a shapefile named LBH140.
MUVD—A shapefile will be created based on the feature class subtype. The exported shapefile will be named using the geometry type prefix, for example, S for surface features, C for curve features, P for point features, and the feature code. For example, the river subtype BH140 in the WatercrsL feature class would be exported to a shapefile named CBH140.
String
Create Empty Shapefiles
Specifies whether empty shapefiles will be created if the input feature classes are empty.
Checked—Empty shapefiles will be created if the corresponding input feature classes are empty.
Unchecked—Empty shapefiles will not be created if the corresponding input feature classes are empty. This is the default.
Boolean
Derived output
Label
Explanation
Data type
Derived Folder
The folder containing output shapefiles created from the Input Features parameter value.
The folder that will contain the output shapefiles.
Folder
coded_value_domain_export_mode
Specifies the method that will be used to export coded domain values.
DESCRIPTIONS—Coded domain values will be exported using their descriptions rather than raw values.
VALUES—Coded domain values will be exported as raw values. This is the default.
VALUES_AND_DESCRIPTIONS—Coded domain values will be exported as raw values and string descriptions
String
conversion_method
Specifies the conversion method that will be applied.
DEFENSE_BY_FEATURECLASS—A shapefile will be created based on the feature class name and trailing underscores will be removed from fields.
DEFENSE_BY_SUBTYPE—A shapefile will be created based on the subtype name, attributes applicable to that subtype will be exported, and trailing underscores will be removed from fields. This is the default.
GENERIC_BY_FEATURECLASS—A shapefile will be created for each feature class selected. The shapefile name must match the feature class name.
GENERIC_BY_SUBTYPE—A shapefile will be created for each subtype of the feature class selected. The shapefile name must match the subtype name.
MGCP—A shapefile will be created based on the feature class subtype. The exported shapefile will be named using the geometry type prefix, for example, S for surface features, L for line features, P for point features, and the feature code. For example, the river subtype BH140 in the WatrcrsL feature class would be exported to a shapefile named LBH140.
MUVD—A shapefile will be created based on the feature class subtype. The exported shapefile will be named using the geometry type prefix, for example, S for surface features, C for curve features, P for point features, and the feature code. For example, the river subtype BH140 in the WatercrsL feature class would be exported to a shapefile named CBH140.
String
create_empties
Specifies whether empty shapefiles will be created if the input feature classes are empty.
CREATE_EMPTIES—Empty shapefiles will be created if the corresponding input feature classes are empty.
NO_CREATE_EMPTIES—Empty shapefiles will not be created if the corresponding input feature classes are empty. This is the default.
Boolean
Derived output
Name
Explanation
Data type
derived_folder
The folder containing output shapefiles created from the input_features parameter value.
Folder
Code sample
GeodatabaseToShape example (stand-alone script)
The following stand-alone script demonstrates how to use the GeodatabaseToShape function to export feature classes from an MGCP workspace to shapefiles.
# Name: GeodatabaseToShape_sample.py
# Description: Exports feature classes from an MGCP workspace to shapefiles
# Import System Modules
import arcpy
# Setting Local Variables
in_features = r'C:\Temp\Test.gdb\MGCP\AerofacA;C:\Temp\Test.gdb\MGCP\AerofacP;C:\Temp\Test.gdb\MGCP\AgristrA;C:\Temp\Test.gdb\MGCP\AgristrP'
in_shape_folder = r'C:\Temp\Shapefiles'
in_output_type = 'Values'
in_conversion_method = 'MGCP'
# Run Geodatabase To Shape Function
arcpy.topographic.GeodatabaseToShape(in_features, in_shape_folder, in_output_type, in_conversion_method)